Skip to content

Commit

Permalink
never set metadata/storage_adapter to wings or AF if disable_wings
Browse files Browse the repository at this point in the history
some test on `.koppie` seem to fail on test order(?) issues, when they decide to
use the Wings adapter for metadata persistence. it seems like something during
the test suite run is setting the adapter to `:wings_adapter` and then not
unsetting it. my best guess is that something is requiring `wings` or
`wings/setup` (maybe via `wings/helper`) during the test run.
  • Loading branch information
tamsin johnson authored and tamsin johnson committed Aug 29, 2023
1 parent a1770c3 commit 967f255
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/wings/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def build_or_set(attributes, &block)
Valkyrie::MetadataAdapter.register(
Wings::Valkyrie::MetadataAdapter.new, :wings_adapter
)
Valkyrie.config.metadata_adapter = :wings_adapter
Valkyrie.config.metadata_adapter = :wings_adapter unless Hyrax.config.disable_wings

Valkyrie::StorageAdapter.register(
Wings::Valkyrie::Storage.new, :active_fedora
)
Valkyrie.config.storage_adapter = :active_fedora
Valkyrie.config.storage_adapter = :active_fedora unless Hyrax.config.disable_wings

# TODO: Custom query registration is not Wings specific. These custom_queries need to be registered for other adapters too.
# A refactor is needed to add the default implementations to hyrax.rb and only handle the wings specific overrides here.
Expand Down
6 changes: 4 additions & 2 deletions spec/wings_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
require 'wings'
unless Hyrax.config.disable_wings
require 'wings'

Dir[File.expand_path(File.join(File.dirname(__FILE__), 'wings', 'support', 'matchers', '**', '*.rb'))].each { |f| require f }
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'wings', 'support', 'matchers', '**', '*.rb'))].each { |f| require f }
end

0 comments on commit 967f255

Please sign in to comment.