Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with latest ruby versions #919

Merged
merged 3 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 59 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,38 @@ workflows:
version: 2
build:
jobs:
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.2.0
name: "Ruby3-2_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 2.7.7
name: "Ruby2-7_Rails6-0"
ruby: 3.2.0
name: "Ruby3-2_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.1.3
name: "Ruby3-1_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 3.1.3
name: "Ruby3-1_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.0.5
name: "Ruby3-0_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 3.0.5
name: "Ruby3-0_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 2.7.7
name: "Ruby2-7_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 2.7.7
name: "Ruby2-7_Rails6-0"
- build:
gemfile: "gemfiles/faraday_1.gemfile"
ruby: 2.7.7
Expand All @@ -113,16 +137,17 @@ workflows:
name: "Faraday0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 2.6.5
ruby: 2.6.10
name: "Ruby2-6_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_5_2.gemfile"
ruby: 2.7.7
name: "Ruby2-7_Rails5-2"
- build:
gemfile: "gemfiles/activerecord_5_2.gemfile"
ruby: 2.6.5
ruby: 2.6.10
name: "Ruby2-6_Rails5-2"

nightly:
triggers:
- schedule:
Expand All @@ -132,6 +157,34 @@ workflows:
only:
- master
jobs:
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.2.0
name: "Ruby3-2_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 3.2.0
name: "Ruby3-2_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.1.3
name: "Ruby3-1_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 3.1.3
name: "Ruby3-1_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 3.0.5
name: "Ruby3-0_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 3.0.5
name: "Ruby3-0_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_7_0.gemfile"
ruby: 2.7.7
name: "Ruby2-7_rails7-0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 2.7.7
Expand All @@ -146,13 +199,13 @@ workflows:
name: "Faraday0"
- build:
gemfile: "gemfiles/activerecord_6_0.gemfile"
ruby: 2.6.5
ruby: 2.6.10
name: "Ruby2-6_Rails6-0"
- build:
gemfile: "gemfiles/activerecord_5_2.gemfile"
ruby: 2.7.7
name: "Ruby2-7_Rails5-2"
- build:
gemfile: "gemfiles/activerecord_5_2.gemfile"
ruby: 2.6.5
ruby: 2.6.10
name: "Ruby2-6_Rails5-2"
4 changes: 2 additions & 2 deletions lib/valkyrie/persistence/fedora/ordered_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class HeadSentinel < Sentinel
# @param parent [Valkyrie::Persistence::Fedora::OrderedList]
# @param next_node [ListNode]
# @param prev_node [ListNode]
def initialize(*args)
def initialize(*args, **kwargs)
super
@next ||= TailSentinel.new(parent, prev_node: self)
end
Expand All @@ -166,7 +166,7 @@ class TailSentinel < Sentinel
# @param parent [Valkyrie::Persistence::Fedora::OrderedList]
# @param next_node [ListNode]
# @param prev_node [ListNode]
def initialize(*args)
def initialize(*args, **kwargs)
super
prev.next = self if prev&.next != self
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/fedora_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def fedora_auth
end

def wipe_fedora!(base_path:, fedora_version: 4)
Valkyrie::Persistence::Fedora::MetadataAdapter.new(fedora_adapter_config(base_path: base_path, fedora_version: fedora_version)).persister.wipe!
Valkyrie::Persistence::Fedora::MetadataAdapter.new(**fedora_adapter_config(base_path: base_path, fedora_version: fedora_version)).persister.wipe!
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/valkyrie/persistence/fedora/metadata_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[4, 5, 6].each do |fedora_version|
context "fedora #{fedora_version}" do
let(:version) { fedora_version }
let(:adapter) { described_class.new(fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
let(:adapter) { described_class.new(**fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
it_behaves_like "a Valkyrie::MetadataAdapter"

describe "#schema" do
Expand All @@ -15,7 +15,7 @@
end

context "with a custom schema" do
let(:adapter) { described_class.new(fedora_adapter_config(base_path: "test_fed", schema: "custom-schema", fedora_version: version)) }
let(:adapter) { described_class.new(**fedora_adapter_config(base_path: "test_fed", schema: "custom-schema", fedora_version: version)) }
specify { expect(adapter.schema).to eq("custom-schema") }
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:version) { fedora_version }
let(:adapter) do
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
fedora_adapter_config(base_path: "test_fed", schema: schema, fedora_version: version)
**fedora_adapter_config(base_path: "test_fed", schema: schema, fedora_version: version)
)
end

Expand All @@ -27,7 +27,7 @@ class SampleResource < Valkyrie::Resource

context "with the default schema" do
let(:schema) { Valkyrie::Persistence::Fedora::PermissiveSchema.new }
let(:query) { converter.convert.graph.query(predicate: RDF::URI("http://example.com/predicate/title")) }
let(:query) { converter.convert.graph.query([nil, RDF::URI("http://example.com/predicate/title"), nil]) }

it "persists to Fedora using a fake predicate" do
expect(query.first.object.to_s).to eq("My Title")
Expand All @@ -36,7 +36,7 @@ class SampleResource < Valkyrie::Resource

context "with a defined schema" do
let(:schema) { Valkyrie::Persistence::Fedora::PermissiveSchema.new(title: ::RDF::Vocab::DC.title) }
let(:query) { converter.convert.graph.query(predicate: ::RDF::Vocab::DC.title) }
let(:query) { converter.convert.graph.query([nil, ::RDF::Vocab::DC.title, nil]) }

it "persists to Fedora using the defined predicate" do
expect(query.first.object.to_s).to eq("My Title")
Expand Down
2 changes: 1 addition & 1 deletion spec/valkyrie/persistence/fedora/persister_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

let(:adapter) do
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
fedora_adapter_config(
**fedora_adapter_config(
base_path: "test_fed",
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(title: RDF::URI("http://example.com/title")),
fedora_version: version
Expand Down
2 changes: 1 addition & 1 deletion spec/valkyrie/persistence/fedora/query_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[4, 5, 6].each do |fedora_version|
context "fedora #{fedora_version}" do
let(:version) { fedora_version }
let(:adapter) { Valkyrie::Persistence::Fedora::MetadataAdapter.new(fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
let(:adapter) { Valkyrie::Persistence::Fedora::MetadataAdapter.new(**fedora_adapter_config(base_path: "test_fed", fedora_version: version)) }
let(:persister) { adapter.persister }
let(:query_service) { adapter.query_service }
it_behaves_like "a Valkyrie query provider"
Expand Down
10 changes: 5 additions & 5 deletions spec/valkyrie/storage/fedora_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
wipe_fedora!(base_path: "test", fedora_version: 4)
end

let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 4)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 4)) }
let(:file) { fixture_file_upload('files/example.tif', 'image/tiff') }

it_behaves_like "a Valkyrie::StorageAdapter"
Expand Down Expand Up @@ -50,7 +50,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
wipe_fedora!(base_path: "test", fedora_version: 5)
end

let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:file) { fixture_file_upload('files/example.tif', 'image/tiff') }

it_behaves_like "a Valkyrie::StorageAdapter"
Expand Down Expand Up @@ -91,7 +91,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
end
context 'when using default transformer' do
context 'and basepath is passed in' do
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = 'fedora://localhost:8998/rest/test/AN1D4UHA/original'
Expand All @@ -100,7 +100,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
end

context "when basepath uses default (e.g. '/')" do
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: '/', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: '/', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = RDF::URI.new('fedora://localhost:8998/rest/AN1D4UHA/original')
Expand Down Expand Up @@ -128,7 +128,7 @@ class Valkyrie::Specs::FedoraCustomResource < Valkyrie::Resource
RDF::URI.new(base_url + (head.scan(/..?/).first(4) + [id]).join('/'))
end
end
let(:storage_adapter) { described_class.new(fedora_adapter_config(base_path: 'test', fedora_version: 5)) }
let(:storage_adapter) { described_class.new(**fedora_adapter_config(base_path: 'test', fedora_version: 5)) }

it 'produces a valid URI' do
expected_uri = 'fedora://localhost:8998/rest/test/AN/1D/4U/HA/AN1D4UHA/original'
Expand Down