Skip to content

Bring tests from jupiter into oaisys with required changes/additions#58

Open
ConnorSheremeta wants to merge 14 commits intomainfrom
cds/bring_over_tests_and_necessary_files
Open

Bring tests from jupiter into oaisys with required changes/additions#58
ConnorSheremeta wants to merge 14 commits intomainfrom
cds/bring_over_tests_and_necessary_files

Conversation

@ConnorSheremeta
Copy link
Collaborator

No description provided.

Copy link
Member

@pgwillia pgwillia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that we can setup the tests with a simpler dummy application.

Starting here:

# test/dummy/config/initializers/dummy.rb
Rails.application.config.after_initialize do
  Oaisys::Engine.config.oai_dc_model = Item
  Oaisys::Engine.config.oai_etdms_model = Thesis
  Oaisys::Engine.config.top_level_sets_model = Community
  Oaisys::Engine.config.set_model = Collection
end

Then we can use the model generator to create the Item, Thesis, Collection and Community.

For example the Thesis needs all of the things for the OaiEtdms serializer
rails g model Thesis title:string creator:string subject:string description:string contributor:string date:date type:string language:string rights:string publisher:string degree_name:string degree_level:string discipline:string institution:string member_of_paths:json

Then we can move the resulting files into the dummy application and finish setting up the model

class Thesis < ActiveRecord::Base

  acts_as_rdfable formats: :oai_etdms

  singleton_class.send(:alias_method, :public_items, :all)

end

We might have to setup a couple more details like kaminari for pagination (page) and uuids for the id.

Keep going with only the minimum for the other models.


def bad_verb
bad_verb = params.permit(:verb).to_h[:verb]
bad_verb = params.permit(:verb, :subdomain).to_h[:verb]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bug in the current release?

oaisys.gemspec Outdated
spec.summary = 'OAI-PMH engine'
spec.description = "Jupiter's engine for Open Archives Initiative Protocol for Metadata Harvesting"
spec.license = 'MIT'
spec.required_ruby_version = '2.6.6'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,107 @@
require 'test_helper'

class OaisysListSetsTest < ActionDispatch::IntegrationTest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it works without any changes to the Dummy application!

@ConnorSheremeta ConnorSheremeta self-assigned this Feb 15, 2023
@ConnorSheremeta ConnorSheremeta requested a review from pgwillia March 7, 2023 15:13
Copy link
Member

@pgwillia pgwillia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that we can setup the tests with a simpler dummy application.

Starting here:

# test/dummy/config/initializers/dummy.rb
Rails.application.config.after_initialize do
  Oaisys::Engine.config.oai_dc_model = Item
  Oaisys::Engine.config.oai_etdms_model = Thesis
  Oaisys::Engine.config.top_level_sets_model = Community
  Oaisys::Engine.config.set_model = Collection
end

Then we can use the model generator to create the Item, Thesis, Collection and Community.

For example the Thesis needs all of the things for the OaiEtdms serializer rails g model Thesis title:string creator:string subject:string description:string contributor:string date:date type:string language:string rights:string publisher:string degree_name:string degree_level:string discipline:string institution:string member_of_paths:json

Then we can move the resulting files into the dummy application and finish setting up the model

class Thesis < ActiveRecord::Base

  acts_as_rdfable formats: :oai_etdms

  singleton_class.send(:alias_method, :public_items, :all)

end

We might have to setup a couple more details like kaminari for pagination (page) and uuids for the id.

Keep going with only the minimum for the other models.

I feel like there might still be some extra stuff in the dummy application. What is important to oaisys about the search exporters, validations, and depositable and doiable behaviours?

id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Setup redis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is redis required for?

Comment on lines +22 to +23
gem 'aasm' # state-machine management
gem 'paper_trail' # Track object changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these necessary for oaisys?

@@ -0,0 +1,5 @@
module Digitization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants