From 141cbcedac92386711e0112849ad0c57ee271d3e Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Wed, 20 Mar 2024 09:05:46 +0100 Subject: [PATCH 1/2] update minitest, bigdecimal, and activesupport to newer versions --- Gemfile | 15 +++++++++------ Gemfile.lock | 48 +++++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/Gemfile b/Gemfile index ec1f76f3..288250fa 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ source 'https://rubygems.org' - -gem 'activesupport', '~> 3.2' +gem 'activesupport', '~> 5' # see https://github.com/ncbo/ontologies_api/issues/69 -gem 'bigdecimal', '1.4.2' +gem 'bigdecimal' +gem 'faraday', '~> 1.9' gem 'json-schema', '~> 2.0' -gem 'multi_json', '~> 1.0' -gem 'oj', '~> 3.0' +gem 'multi_json' +gem 'oj' gem 'parseconfig' gem 'rack' gem 'rake', '~> 10.0' @@ -69,9 +69,12 @@ group :profiling do end group :test do - gem 'minitest', '~> 4.0' + gem 'minitest', '~> 5.0' gem 'minitest-stub_any_instance' gem 'rack-test' gem 'simplecov', require: false gem 'simplecov-cobertura' # for codecov.io + gem 'crack', '0.4.5' + gem 'webmock' + gem "minitest-hooks", "~> 1.5" end diff --git a/Gemfile.lock b/Gemfile.lock index 37f2a36d..c17a0941 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,9 +100,11 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (3.2.22.5) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) + activesupport (5.2.8.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) airbrussh (1.5.1) @@ -112,7 +114,7 @@ GEM base64 (0.2.0) bcrypt (3.1.20) bcrypt_pbkdf (1.1.0) - bigdecimal (1.4.2) + bigdecimal (3.1.6) builder (3.2.4) capistrano (3.18.1) airbrussh (>= 1.0.0) @@ -128,7 +130,8 @@ GEM sshkit (~> 1.3) coderay (1.1.3) concurrent-ruby (1.2.3) - connection_pool (2.4.1) + crack (0.4.5) + rexml cube-ruby (0.0.3) dante (0.2.0) date (3.3.4) @@ -168,7 +171,6 @@ GEM google-protobuf (3.25.3-aarch64-linux) google-protobuf (3.25.3-arm64-darwin) google-protobuf (3.25.3-x86_64-darwin) - google-protobuf (3.25.3-x86_64-linux) googleapis-common-protos (1.5.0) google-protobuf (~> 3.18) googleapis-common-protos-types (~> 1.7) @@ -191,16 +193,14 @@ GEM grpc (1.62.0-x86_64-darwin) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) - grpc (1.62.0-x86_64-linux) - google-protobuf (~> 3.25) - googleapis-common-protos-types (~> 1.0) haml (5.2.2) temple (>= 0.8.0) tilt http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - i18n (0.9.5) + httpclient (2.8.3) + i18n (1.14.1) concurrent-ruby (~> 1.0) json (2.7.1) json-schema (2.8.1) @@ -224,7 +224,9 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2024.0305) mini_mime (1.1.5) - minitest (4.7.5) + minitest (5.22.2) + minitest-hooks (1.5.1) + minitest (> 5.3) minitest-stub_any_instance (1.0.3) mlanett-redis-lock (0.2.7) redis @@ -247,7 +249,8 @@ GEM net-ssh (7.2.1) netrc (0.11.0) newrelic_rpm (9.7.1) - oj (3.16.1) + oj (3.16.3) + bigdecimal (>= 3.0) omni_logger (0.1.4) logger os (1.1.4) @@ -357,11 +360,13 @@ GEM net-ssh (>= 2.8.0) systemu (2.6.5) temple (0.10.3) + thread_safe (0.3.6) tilt (2.3.0) timeout (0.4.1) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + trailblazer-option (0.1.2) + tzinfo (1.2.11) + thread_safe (~> 0.1) + uber (0.1.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -377,30 +382,31 @@ PLATFORMS arm64-darwin-23 x86_64-darwin-18 x86_64-darwin-23 - x86_64-linux DEPENDENCIES - activesupport (~> 3.2) + activesupport (~> 5) bcrypt_pbkdf (>= 1.0, < 2.0) - bigdecimal (= 1.4.2) + bigdecimal capistrano (~> 3) capistrano-bundler capistrano-locally capistrano-rbenv + crack (= 0.4.5) cube-ruby ed25519 (>= 1.2, < 2.0) ffi goo! haml (~> 5.2.2) json-schema (~> 2.0) - minitest (~> 4.0) + minitest (~> 5.0) + minitest-hooks (~> 1.5) minitest-stub_any_instance - multi_json (~> 1.0) + multi_json ncbo_annotator! ncbo_cron! ncbo_ontology_recommender! newrelic_rpm - oj (~> 3.0) + oj ontologies_linked_data! parseconfig rack From b3c5eb795875ff884c5c9b1ceb12affb5d67f5d0 Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Wed, 20 Mar 2024 09:06:05 +0100 Subject: [PATCH 2/2] update the tests files to use the new minitest framework --- .env | 6 ++ Gemfile | 12 +-- Gemfile.lock | 85 ++++++++++++------- test/controllers/test_annotator_controller.rb | 4 +- test/controllers/test_batch_controller.rb | 2 +- test/controllers/test_classes_controller.rb | 2 +- test/controllers/test_instances_controller.rb | 2 +- test/controllers/test_mappings_controller.rb | 4 +- test/controllers/test_metrics_controller.rb | 2 +- test/controllers/test_notes_controller.rb | 6 +- .../controllers/test_ontologies_controller.rb | 10 +-- .../test_ontology_analytics_controller.rb | 8 +- .../test_ontology_submissions_controller.rb | 9 +- .../controllers/test_properties_controller.rb | 4 +- .../test_properties_search_controller.rb | 6 +- .../test_provisional_classes_controller.rb | 8 +- .../test_provisional_relations_controller.rb | 8 +- .../test_recommender_controller.rb | 2 +- .../test_recommender_v1_controller.rb | 2 +- test/controllers/test_replies_controller.rb | 4 +- test/controllers/test_search_controller.rb | 5 +- test/controllers/test_slices_controller.rb | 13 ++- test/controllers/test_users_controller.rb | 2 +- test/helpers/test_access_control_helper.rb | 11 +-- test/helpers/test_application_helper.rb | 2 +- test/helpers/test_http_cache_helper.rb | 8 +- test/helpers/test_slices_helper.rb | 11 ++- test/helpers/test_users_helper.rb | 9 +- test/middleware/test_rack_attack.rb | 6 +- test/test_case.rb | 36 +++++--- 30 files changed, 167 insertions(+), 122 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 00000000..2b53fceb --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +API_URL=http://localhost:9393 +ONTOLOGIES_LINKED_DATA_PATH= +GOO_PATH= +SPARQL_CLIENT_PATH= +ONTOPORTAL_KB=ontoportal_kb +REDIS_HOST=redis-ut diff --git a/Gemfile b/Gemfile index 288250fa..3048681d 100644 --- a/Gemfile +++ b/Gemfile @@ -41,12 +41,12 @@ gem 'haml', '~> 5.2.2' # pin see https://github.com/ncbo/ontologies_api/pull/107 gem 'redcarpet' # NCBO -gem 'goo', github: 'ncbo/goo', branch: 'master' -gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'master' -gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'master' -gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'master' -gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'master' -gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master' +gem 'goo', github: 'ncbo/goo', branch: 'develop' +gem 'ncbo_annotator', github: 'ncbo/ncbo_annotator', branch: 'develop' +gem 'ncbo_cron', github: 'ncbo/ncbo_cron', branch: 'develop' +gem 'ncbo_ontology_recommender', github: 'ncbo/ncbo_ontology_recommender', branch: 'develop' +gem 'ontologies_linked_data', github: 'ncbo/ontologies_linked_data', branch: 'develop' +gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'develop' group :development do # bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42 diff --git a/Gemfile.lock b/Gemfile.lock index c17a0941..a64ad257 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GIT remote: https://github.com/ncbo/goo.git - revision: 75436fe8e387febc53e34ee31ff0e6dd837a9d3f - branch: master + revision: 87e991b0e720c580a71e2c2c10f9ab44183db322 + branch: develop specs: goo (0.0.2) addressable (~> 2.8) @@ -15,8 +15,8 @@ GIT GIT remote: https://github.com/ncbo/ncbo_annotator.git - revision: 63c986880aa88c9384043e6611a682434a14aba7 - branch: master + revision: fe0783c542479ed0a12da5663ef28e1673e80eba + branch: develop specs: ncbo_annotator (0.0.1) goo @@ -26,8 +26,8 @@ GIT GIT remote: https://github.com/ncbo/ncbo_cron.git - revision: b5764cc314758dbfdbb855b2b63c1c53b1325f6f - branch: master + revision: 2f8b1c1cff9a00da06ff68c1449f049e3f59c5ce + branch: develop specs: ncbo_cron (0.0.1) dante @@ -42,8 +42,8 @@ GIT GIT remote: https://github.com/ncbo/ncbo_ontology_recommender.git - revision: 013abea4af3b10910ec661dbb358a4b6cae198a4 - branch: master + revision: d047de0a9650df321db47300eba8ff8c195e0854 + branch: develop specs: ncbo_ontology_recommender (0.0.1) goo @@ -53,8 +53,8 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: b6df920d03af15ee35a3a7c31078c6ea263ba41d - branch: master + revision: a466d530877cb48cdfb811d0b61ecaabd2b835eb + branch: develop specs: ontologies_linked_data (0.0.1) activesupport @@ -73,8 +73,8 @@ GIT GIT remote: https://github.com/ncbo/sparql-client.git - revision: d418d56a6c9ff5692f925b45739a2a1c66bca851 - branch: master + revision: 55e7dbf858eb571c767bc67868f9af61663859cb + branch: develop specs: sparql-client (1.0.1) json_pure (>= 1.4) @@ -114,7 +114,7 @@ GEM base64 (0.2.0) bcrypt (3.1.20) bcrypt_pbkdf (1.1.0) - bigdecimal (3.1.6) + bigdecimal (3.1.7) builder (3.2.4) capistrano (3.18.1) airbrussh (>= 1.0.0) @@ -130,6 +130,7 @@ GEM sshkit (~> 1.3) coderay (1.1.3) concurrent-ruby (1.2.3) + connection_pool (2.4.1) crack (0.4.5) rexml cube-ruby (0.0.3) @@ -138,13 +139,29 @@ GEM docile (1.4.0) domain_name (0.6.20240107) ed25519 (1.3.0) - faraday (2.8.1) - base64 - faraday-net_http (>= 2.0, < 3.1) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - faraday-retry (2.2.0) - faraday (~> 2.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) ffi (1.16.3) gapic-common (0.21.1) faraday (>= 1.9, < 3.a) @@ -168,14 +185,14 @@ GEM google-cloud-env (2.1.1) faraday (>= 1.0, < 3.a) google-cloud-errors (1.4.0) - google-protobuf (3.25.3-aarch64-linux) google-protobuf (3.25.3-arm64-darwin) google-protobuf (3.25.3-x86_64-darwin) + google-protobuf (3.25.3-x86_64-linux) googleapis-common-protos (1.5.0) google-protobuf (~> 3.18) googleapis-common-protos-types (~> 1.7) grpc (~> 1.41) - googleapis-common-protos-types (1.13.0) + googleapis-common-protos-types (1.14.0) google-protobuf (~> 3.18) googleauth (1.11.0) faraday (>= 1.0, < 3.a) @@ -184,23 +201,23 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grpc (1.62.0-aarch64-linux) - google-protobuf (~> 3.25) - googleapis-common-protos-types (~> 1.0) grpc (1.62.0-arm64-darwin) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) grpc (1.62.0-x86_64-darwin) google-protobuf (~> 3.25) googleapis-common-protos-types (~> 1.0) + grpc (1.62.0-x86_64-linux) + google-protobuf (~> 3.25) + googleapis-common-protos-types (~> 1.0) haml (5.2.2) temple (>= 0.8.0) tilt + hashdiff (1.1.0) http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - httpclient (2.8.3) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) json (2.7.1) json-schema (2.8.1) @@ -224,13 +241,14 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2024.0305) mini_mime (1.1.5) - minitest (5.22.2) + minitest (5.22.3) minitest-hooks (1.5.1) minitest (> 5.3) minitest-stub_any_instance (1.0.3) mlanett-redis-lock (0.2.7) redis multi_json (1.15.0) + multipart-post (2.4.0) mutex_m (0.2.0) net-http-persistent (2.9.4) net-imap (0.4.10) @@ -363,10 +381,9 @@ GEM thread_safe (0.3.6) tilt (2.3.0) timeout (0.4.1) - trailblazer-option (0.1.2) tzinfo (1.2.11) thread_safe (~> 0.1) - uber (0.1.0) + unicode-display_width (2.5.0) unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -375,13 +392,15 @@ GEM unicorn (>= 4, < 7) uuid (2.3.9) macaddr (~> 1.0) + webmock (3.23.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS - aarch64-linux arm64-darwin-22 - arm64-darwin-23 x86_64-darwin-18 - x86_64-darwin-23 + x86_64-linux DEPENDENCIES activesupport (~> 5) @@ -394,6 +413,7 @@ DEPENDENCIES crack (= 0.4.5) cube-ruby ed25519 (>= 1.2, < 2.0) + faraday (~> 1.9) ffi goo! haml (~> 5.2.2) @@ -433,6 +453,7 @@ DEPENDENCIES sparql-client! unicorn unicorn-worker-killer + webmock BUNDLED WITH 2.4.22 diff --git a/test/controllers/test_annotator_controller.rb b/test/controllers/test_annotator_controller.rb index 3b21b9e7..751176f6 100644 --- a/test/controllers/test_annotator_controller.rb +++ b/test/controllers/test_annotator_controller.rb @@ -2,7 +2,7 @@ class TestAnnotatorController < TestCase - def self.before_suite + def before_suite @@redis = Redis.new(:host => Annotator.settings.annotator_redis_host, :port => Annotator.settings.annotator_redis_port) db_size = @@redis.dbsize if db_size > MAX_TEST_REDIS_SIZE @@ -20,7 +20,7 @@ def self.before_suite annotator = Annotator::Models::NcboAnnotator.new annotator.init_redis_for_tests() annotator.create_term_cache_from_ontologies(@@ontologies, false) - mapping_test_set + self.class.mapping_test_set end def test_annotate diff --git a/test/controllers/test_batch_controller.rb b/test/controllers/test_batch_controller.rb index 55d9cee9..a4da9766 100644 --- a/test/controllers/test_batch_controller.rb +++ b/test/controllers/test_batch_controller.rb @@ -1,7 +1,7 @@ require_relative '../test_case' class TestBatchController < TestCase - def self.before_suite + def before_suite LinkedData::SampleData::Ontology.delete_ontologies_and_submissions @@ontologies = LinkedData::SampleData::Ontology.sample_owl_ontologies end diff --git a/test/controllers/test_classes_controller.rb b/test/controllers/test_classes_controller.rb index a918ece0..b88ec369 100644 --- a/test/controllers/test_classes_controller.rb +++ b/test/controllers/test_classes_controller.rb @@ -2,7 +2,7 @@ class TestClassesController < TestCase - def self.before_suite + def before_suite options = {ont_count: 1, submission_count: 3, submissions_to_process: [1, 2], diff --git a/test/controllers/test_instances_controller.rb b/test/controllers/test_instances_controller.rb index 4e9b8a5c..1735455f 100644 --- a/test/controllers/test_instances_controller.rb +++ b/test/controllers/test_instances_controller.rb @@ -2,7 +2,7 @@ class TestInstancesController < TestCase - def self.before_suite + def before_suite LinkedData::SampleData::Ontology.create_ontologies_and_submissions({ process_submission: true, acronym: 'XCT-TEST-INST', diff --git a/test/controllers/test_mappings_controller.rb b/test/controllers/test_mappings_controller.rb index 44bfa032..d8c6f619 100644 --- a/test/controllers/test_mappings_controller.rb +++ b/test/controllers/test_mappings_controller.rb @@ -2,8 +2,8 @@ class TestMappingsController < TestCase - def self.before_suite - + def before_suite + self.backend_4s_delete ["BRO-TEST-MAP-0","CNO-TEST-MAP-0","FAKE-TEST-MAP-0"].each do |acr| LinkedData::Models::OntologySubmission.where(ontology: [acronym: acr]).to_a.each do |s| s.delete diff --git a/test/controllers/test_metrics_controller.rb b/test/controllers/test_metrics_controller.rb index 1b8890a6..94e55af8 100644 --- a/test/controllers/test_metrics_controller.rb +++ b/test/controllers/test_metrics_controller.rb @@ -2,7 +2,7 @@ class TestMetricsController < TestCase - def self.before_suite + def before_suite if OntologySubmission.all.count > 100 puts "this test is going to wipe out all submission and ontologies. probably this is not a test env." return diff --git a/test/controllers/test_notes_controller.rb b/test/controllers/test_notes_controller.rb index d9223669..0c7d2bcb 100644 --- a/test/controllers/test_notes_controller.rb +++ b/test/controllers/test_notes_controller.rb @@ -3,9 +3,9 @@ class TestNotesController < TestCase - def self.before_suite - self.new("before_suite").delete_ontologies_and_submissions - @@ontology, @@cls = self.new("before_suite")._ontology_and_class + def before_suite + self.delete_ontologies_and_submissions + @@ontology, @@cls = self._ontology_and_class @@note_user = "test_note_user" @@user = LinkedData::Models::User.new( diff --git a/test/controllers/test_ontologies_controller.rb b/test/controllers/test_ontologies_controller.rb index 4f61256b..1f99912d 100644 --- a/test/controllers/test_ontologies_controller.rb +++ b/test/controllers/test_ontologies_controller.rb @@ -2,11 +2,11 @@ require_relative '../test_case' class TestOntologiesController < TestCase - def self.before_suite - _set_vars - _delete - _create_user - _create_onts + def before_suite + self.class._set_vars + self.class._delete + self.class._create_user + self.class._create_onts end def teardown diff --git a/test/controllers/test_ontology_analytics_controller.rb b/test/controllers/test_ontology_analytics_controller.rb index b8e36dce..721efea6 100644 --- a/test/controllers/test_ontology_analytics_controller.rb +++ b/test/controllers/test_ontology_analytics_controller.rb @@ -196,7 +196,7 @@ class TestOntologyAnalyticsController < TestCase } } - def self.before_suite + def before_suite @@redis = Redis.new(:host => Annotator.settings.annotator_redis_host, :port => Annotator.settings.annotator_redis_port) db_size = @@redis.dbsize if db_size > MAX_TEST_REDIS_SIZE @@ -212,9 +212,9 @@ def self.before_suite "SNOMEDCT" => "SNOMEDCT Ontology", "TST" => "TST Ontology" } - _delete - _create_user - _create_onts + self.class._delete + self.class._create_user + self.class._create_onts end def teardown diff --git a/test/controllers/test_ontology_submissions_controller.rb b/test/controllers/test_ontology_submissions_controller.rb index 40532cd0..4660e10b 100644 --- a/test/controllers/test_ontology_submissions_controller.rb +++ b/test/controllers/test_ontology_submissions_controller.rb @@ -2,10 +2,11 @@ class TestOntologySubmissionsController < TestCase - def self.before_suite - _set_vars - _create_user - _create_onts + def before_suite + self.backend_4s_delete + self.class._set_vars + self.class._create_user + self.class._create_onts end def self._set_vars diff --git a/test/controllers/test_properties_controller.rb b/test/controllers/test_properties_controller.rb index 8248403c..1bd30d5b 100644 --- a/test/controllers/test_properties_controller.rb +++ b/test/controllers/test_properties_controller.rb @@ -2,7 +2,7 @@ class TestPropertiesController < TestCase - def self.before_suite + def before_suite count, acronyms, bro = LinkedData::SampleData::Ontology.create_ontologies_and_submissions({ process_submission: true, acronym: "BROSEARCHTEST", @@ -25,7 +25,7 @@ def self.before_suite @@acronyms = @@ontologies.map { |ont| ont.bring_remaining; ont.acronym } end - def self.after_suite + def after_suite LinkedData::SampleData::Ontology.delete_ontologies_and_submissions end diff --git a/test/controllers/test_properties_search_controller.rb b/test/controllers/test_properties_search_controller.rb index f93a90a1..4302eb97 100644 --- a/test/controllers/test_properties_search_controller.rb +++ b/test/controllers/test_properties_search_controller.rb @@ -2,7 +2,9 @@ class TestPropertiesSearchController < TestCase - def self.before_suite + def before_suite + self.backend_4s_delete + count, acronyms, bro = LinkedData::SampleData::Ontology.create_ontologies_and_submissions({ process_submission: true, acronym: "BROSEARCHTEST", @@ -24,7 +26,7 @@ def self.before_suite @@ontologies = bro.concat(mccl) end - def self.after_suite + def after_suite LinkedData::SampleData::Ontology.delete_ontologies_and_submissions LinkedData::Models::Ontology.indexClear(:property) LinkedData::Models::Ontology.indexCommit(nil, :property) diff --git a/test/controllers/test_provisional_classes_controller.rb b/test/controllers/test_provisional_classes_controller.rb index 7225d772..e54c7805 100644 --- a/test/controllers/test_provisional_classes_controller.rb +++ b/test/controllers/test_provisional_classes_controller.rb @@ -1,9 +1,9 @@ require_relative '../test_case' class TestProvisionalClassesController < TestCase - def self.before_suite - self.new("before_suite").delete_ontologies_and_submissions - @@ontology, classes = self.new("before_suite")._ontology_and_classes + def before_suite + self.delete_ontologies_and_submissions + @@ontology, classes = self._ontology_and_classes @@cls = classes[0] @@cls1 = classes[1] @@ -32,7 +32,7 @@ def self.before_suite end end - def self.after_suite + def after_suite 3.times do |i| @@pcs[i].delete end diff --git a/test/controllers/test_provisional_relations_controller.rb b/test/controllers/test_provisional_relations_controller.rb index 83f2761d..f097dde9 100644 --- a/test/controllers/test_provisional_relations_controller.rb +++ b/test/controllers/test_provisional_relations_controller.rb @@ -1,9 +1,9 @@ require_relative '../test_case' class TestProvisionalRelationsController < TestCase - def self.before_suite - self.new("before_suite").delete_ontologies_and_submissions - @@ontology, classes = self.new("before_suite")._ontology_and_classes + def before_suite + self.delete_ontologies_and_submissions + @@ontology, classes = self._ontology_and_classes @@cls1 = classes[0] @@cls2 = classes[1] @@ -39,7 +39,7 @@ def self.before_suite @@test_rel.save end - def self.after_suite + def after_suite @@test_pc.delete @@test_user.delete end diff --git a/test/controllers/test_recommender_controller.rb b/test/controllers/test_recommender_controller.rb index 29caf28c..96b6e106 100644 --- a/test/controllers/test_recommender_controller.rb +++ b/test/controllers/test_recommender_controller.rb @@ -2,7 +2,7 @@ class TestRecommenderController < TestCase - def self.before_suite + def before_suite @@redis = Redis.new(:host => Annotator.settings.annotator_redis_host, :port => Annotator.settings.annotator_redis_port) db_size = @@redis.dbsize if db_size > MAX_TEST_REDIS_SIZE diff --git a/test/controllers/test_recommender_v1_controller.rb b/test/controllers/test_recommender_v1_controller.rb index 7b14a63d..074cda8f 100644 --- a/test/controllers/test_recommender_v1_controller.rb +++ b/test/controllers/test_recommender_v1_controller.rb @@ -2,7 +2,7 @@ class TestRecommenderController < TestCase - def self.before_suite + def before_suite LinkedData::SampleData::Ontology.delete_ontologies_and_submissions @@ontologies = LinkedData::SampleData::Ontology.sample_owl_ontologies @@text = <