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

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

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.

@@ -14,7 +14,7 @@ class Oaisys::PMHController < Oaisys::ApplicationController
].freeze

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
@@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
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
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?

@@ -40,6 +46,11 @@ jobs:
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