From b987bbdce79b4eb33219b1f380e0fb384487d744 Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 6 Mar 2026 16:41:22 -0800 Subject: [PATCH 1/3] integrate ontoportal testkit --- .github/workflows/ruby-unit-tests.yml | 30 ----- .github/workflows/testkit-unit-tests.yml | 87 +++++++++++++ .ontoportal-testkit.yml | 9 ++ Dockerfile | 30 ++--- Gemfile | 3 +- Gemfile.lock | 38 +++--- config/environments/test.rb | 55 +++------ docker-compose.yml | 150 ----------------------- rakelib/ontoportal_testkit.rake | 2 + 9 files changed, 155 insertions(+), 249 deletions(-) delete mode 100644 .github/workflows/ruby-unit-tests.yml create mode 100644 .github/workflows/testkit-unit-tests.yml create mode 100644 .ontoportal-testkit.yml delete mode 100644 docker-compose.yml create mode 100644 rakelib/ontoportal_testkit.rake diff --git a/.github/workflows/ruby-unit-tests.yml b/.github/workflows/ruby-unit-tests.yml deleted file mode 100644 index 2aac14680..000000000 --- a/.github/workflows/ruby-unit-tests.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Ruby Unit Tests - -on: - push: - pull_request: - -jobs: - test: - strategy: - fail-fast: false - matrix: - backend: ['api', 'api-agraph'] # api runs tests with 4store backend and api-agraph runs with AllegroGraph backend - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build docker-compose - run: docker compose --profile 4store build #profile flag is set in order to build all containers in this step - - name: Run unit tests - # unit tests are run inside a container - # http://docs.codecov.io/docs/testing-with-docker - run: | - ci_env=`bash <(curl -s https://codecov.io/env)` - docker compose run $ci_env -e CI --rm ${{ matrix.backend }} bundle exec rake test TESTOPTS='-v' - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: unittests - verbose: true - fail_ci_if_error: false # optional (default = false) diff --git a/.github/workflows/testkit-unit-tests.yml b/.github/workflows/testkit-unit-tests.yml new file mode 100644 index 000000000..b5fe5ba83 --- /dev/null +++ b/.github/workflows/testkit-unit-tests.yml @@ -0,0 +1,87 @@ +name: Docker Unit Tests + +on: + push: + branches: + - '**' + tags-ignore: + - '**' + pull_request: + +env: + # CI execution mode for backend tests: + # - container: run `test:docker::container` (default) + # - native: run `test:docker:` on host Ruby + OPTK_CI_RUN_MODE: ${{ vars.OPTK_CI_RUN_MODE || 'container' }} + # Example override to force native mode in this workflow file: + # OPTK_CI_RUN_MODE: native + +jobs: + prepare: + runs-on: ubuntu-latest + outputs: + backends: ${{ steps.cfg.outputs.backends }} + steps: + - uses: actions/checkout@v4 + + - id: cfg + name: Read backend matrix from .ontoportal-testkit.yml + run: | + BACKENDS=$(ruby -ryaml -rjson -e 'c=YAML.safe_load_file(".ontoportal-testkit.yml") || {}; b=c["backends"] || %w[fs ag vo gd]; puts JSON.generate(b)') + echo "backends=$BACKENDS" >> "$GITHUB_OUTPUT" + + test: + needs: prepare + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + fail-fast: false + matrix: + backend: ${{ fromJson(needs.prepare.outputs.backends) }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby from .ruby-version + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Set up Java 11 (native mode) + if: env.OPTK_CI_RUN_MODE == 'native' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '11' + + - name: Install native system dependencies + if: env.OPTK_CI_RUN_MODE == 'native' + run: | + sudo apt-get update + sudo apt-get install -y raptor2-utils + + - name: Run unit tests + env: + CI: "true" + TESTOPTS: "-v" + BACKEND: ${{ matrix.backend }} + run: | + MODE="${OPTK_CI_RUN_MODE:-container}" + TASK="test:docker:${BACKEND}" + if [ "$MODE" = "container" ]; then + TASK="${TASK}:container" + elif [ "$MODE" != "native" ]; then + echo "Invalid OPTK_CI_RUN_MODE=$MODE (expected container or native)" + exit 1 + fi + + bundle exec rake "$TASK" + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests,${{ matrix.backend }} + verbose: true + fail_ci_if_error: false diff --git a/.ontoportal-testkit.yml b/.ontoportal-testkit.yml new file mode 100644 index 000000000..c63def5c1 --- /dev/null +++ b/.ontoportal-testkit.yml @@ -0,0 +1,9 @@ +component_name: ontologies_api +app_service: test-container +backends: + - fs + - ag + - vo + - gd +dependency_services: + - mgrep diff --git a/Dockerfile b/Dockerfile index 896b90cb4..3ca8019ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,20 @@ -ARG RUBY_VERSION=3.1 -ARG DISTRO_NAME=bullseye +ARG RUBY_VERSION=3.2 +ARG DISTRO=bullseye +ARG TESTKIT_BASE_IMAGE=ontoportal/testkit-base:ruby${RUBY_VERSION}-${DISTRO} +FROM ${TESTKIT_BASE_IMAGE} -FROM ruby:$RUBY_VERSION-$DISTRO_NAME +WORKDIR /app -RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ - openjdk-11-jre-headless \ - raptor2-utils \ - && rm -rf /var/lib/apt/lists/* +COPY Gemfile* *.gemspec ./ -RUN mkdir -p /srv/ontoportal/ontologies_api -RUN mkdir -p /srv/ontoportal/bundle -COPY Gemfile* /srv/ontoportal/ontologies_api/ +# Respect the project's Bundler lock when present. +RUN if [ -f Gemfile.lock ]; then \ + BUNDLER_VERSION=$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1 | tr -d ' '); \ + gem install bundler -v "$BUNDLER_VERSION"; \ + fi -WORKDIR /srv/ontoportal/ontologies_api +RUN bundle install --jobs 4 --retry 3 -ENV BUNDLE_PATH=/srv/ontoportal/bundle -RUN bundle install +COPY . ./ -COPY . /srv/ontoportal/ontologies_api -RUN cp /srv/ontoportal/ontologies_api/config/environments/config.rb.sample /srv/ontoportal/ontologies_api/config/environments/development.rb - -EXPOSE 9393 CMD ["bundle", "exec", "rackup", "-p", "9393", "--host", "0.0.0.0"] diff --git a/Gemfile b/Gemfile index 922951679..d4f6f3e12 100644 --- a/Gemfile +++ b/Gemfile @@ -77,8 +77,9 @@ group :test do gem 'crack', '0.4.5' gem 'minitest' gem 'minitest-hooks' - gem 'minitest-stub_any_instance' gem 'minitest-reporters' + gem 'minitest-stub_any_instance' + gem 'ontoportal_testkit', github: 'alexskr/ontoportal_testkit', branch: 'main' gem 'rack-test' gem 'simplecov', require: false gem 'simplecov-cobertura' # for codecov.io diff --git a/Gemfile.lock b/Gemfile.lock index b16cddbdd..2e9afb1e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,14 @@ +GIT + remote: https://github.com/alexskr/ontoportal_testkit.git + revision: 5138aa94c028ec97adeaf1f7a5ed9f1c40b12950 + branch: main + specs: + ontoportal_testkit (0.1.0) + rake (>= 13.0) + GIT remote: https://github.com/ncbo/goo.git - revision: f6310650f578200f0e1465bd013dc5a737ef0170 + revision: 93c8ade0f7ef56fa4ad4fbdee0f9c6c4553be287 branch: ontoportal-lirmm-development specs: goo (0.0.2) @@ -18,7 +26,7 @@ GIT GIT remote: https://github.com/ncbo/ncbo_annotator.git - revision: e86ece03c2d80604cdea4d96bd1de6899f6b4762 + revision: 9da3081170369e842aecef94a5bde242d85bf6db branch: chore/ruby3.2-minitest6-compat specs: ncbo_annotator (0.0.1) @@ -29,7 +37,7 @@ GIT GIT remote: https://github.com/ncbo/ncbo_cron.git - revision: 4344c70a1684d39e58272f695b823f7eec4ac13c + revision: ec1cfbb4f2153a00a06afc0b567cf9648e10db5a branch: chore/ontoportal-lirmm-goo-compat specs: ncbo_cron (0.0.1) @@ -58,7 +66,7 @@ GIT GIT remote: https://github.com/ncbo/ontologies_linked_data.git - revision: 637fdfcfc0f9201a631b4d827d34aa8993325565 + revision: 1f83c130045da5d9e0619ae3afc5a0d4a4ac390e branch: chore/ontoportal-lirmm-goo-compat specs: ontologies_linked_data (0.0.1) @@ -251,7 +259,7 @@ GEM i18n (1.14.8) concurrent-ruby (~> 1.0) io-console (0.8.2) - json (2.18.1) + json (2.19.0) json-canonicalization (0.4.0) json-ld (3.2.5) htmlentities (~> 4.3) @@ -285,7 +293,7 @@ GEM mime-types (3.7.0) logger mime-types-data (~> 3.2025, >= 3.2025.0507) - mime-types-data (3.2026.0224) + mime-types-data (3.2026.0303) mini_mime (1.1.5) minitest (6.0.2) drb (~> 2.0) @@ -345,7 +353,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) reline (>= 0.6.0) - public_suffix (7.0.2) + public_suffix (7.0.5) raabro (1.4.0) racc (1.8.1) rack (3.2.5) @@ -392,7 +400,7 @@ GEM rexml (~> 3.2) redis (5.4.1) redis-client (>= 0.22.0) - redis-client (0.26.4) + redis-client (0.27.0) connection_pool redis-rack-cache (2.2.1) rack-cache (>= 1.10, < 2) @@ -496,12 +504,10 @@ GEM webrick (1.9.2) PLATFORMS - aarch64-linux aarch64-linux-gnu arm64-darwin ruby x86_64-darwin - x86_64-linux x86_64-linux-gnu DEPENDENCIES @@ -533,6 +539,7 @@ DEPENDENCIES net-ftp oj ontologies_linked_data! + ontoportal_testkit! pandoc-ruby parallel parseconfig @@ -635,7 +642,7 @@ CHECKSUMS http-cookie (1.1.0) sha256=38a5e60d1527eebc396831b8c4b9455440509881219273a6c99943d29eadbb19 i18n (1.14.8) sha256=285778639134865c5e0f6269e0b818256017e8cde89993fdfcbfb64d088824a5 io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc - json (2.18.1) sha256=fe112755501b8d0466b5ada6cf50c8c3f41e897fa128ac5d263ec09eedc9f986 + json (2.19.0) sha256=bc5202f083618b3af7aba3184146ec9d820f8f6de261838b577173475e499d9a json-canonicalization (0.4.0) sha256=73ea88b68f210d1a09c2116d4cd1ff5a39684c6a409f7ccac70d5b1a426a8bef json-ld (3.2.5) sha256=98b96f1831b0fe9c7d2568a7d43b64f6b8c3f5892d55ccf91640e32a99c273fc json-schema (6.1.0) sha256=6bf70a2cfb6dfd5a06da28093fa8190f324c88eabd36a7f47097f227321dc702 @@ -651,7 +658,7 @@ CHECKSUMS mcp (0.7.1) sha256=fa967895d6952bad0d981ea907731d8528d2c246d2079d56a9c8bae83d14f1c7 method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5 mime-types (3.7.0) sha256=dcebf61c246f08e15a4de34e386ebe8233791e868564a470c3fe77c00eed5e56 - mime-types-data (3.2026.0224) sha256=bea02e0168b37f6935696c4fcfeb3374a0a62e82e6187af5f3f3b709bf67e5fd + mime-types-data (3.2026.0303) sha256=164af1de5824c5195d4b503b0a62062383b65c08671c792412450cd22d3bc224 mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef minitest (6.0.2) sha256=db6e57956f6ecc6134683b4c87467d6dd792323c7f0eea7b93f66bd284adbc3d minitest-hooks (1.5.3) sha256=ef50dd3bf47e6d1646befc358c640c71ca41f5650f0036b4c69929a44d6f32c4 @@ -677,6 +684,7 @@ CHECKSUMS oj (3.16.15) sha256=4d3324cac3e8fef54c0fa250b2af26a16dadd9f9788a1d6b1b2098b793a1b2cd omni_logger (0.1.4) sha256=b61596f7d96aa8426929e46c3500558d33e838e1afd7f4735244feb4d082bb3e ontologies_linked_data (0.0.1) + ontoportal_testkit (0.1.0) os (1.1.4) sha256=57816d6a334e7bd6aed048f4b0308226c5fb027433b67d90a9ab435f35108d3f ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912 pandoc-ruby (2.1.10) sha256=37653d6b5e71657fb25b3cb230e6eebbfb8c925c7f1fcf69dfb6b929d12b74b2 @@ -686,7 +694,7 @@ CHECKSUMS pony (1.13.1) sha256=ab507c8ade8b35de96f1e75c0ae4566a3c40ac8a0d5101433969b6fd29c718a7 prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e - public_suffix (7.0.2) sha256=9114090c8e4e7135c1fd0e7acfea33afaab38101884320c65aaa0ffb8e26a857 + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 raabro (1.4.0) sha256=d4fa9ff5172391edb92b242eed8be802d1934b1464061ae5e70d80962c5da882 racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f rack (3.2.5) sha256=4cbd0974c0b79f7a139b4812004a62e4c60b145cba76422e288ee670601ed6d3 @@ -711,7 +719,7 @@ CHECKSUMS rdf-vocab (3.3.3) sha256=d3b642edb37be7b37b73cafa9e01d55762f99292838e7b0868a3575bd297bf8b rdf-xsd (3.3.0) sha256=fab51d27b20344237d9b622ef32e83e4c44940840bfc76a245ce6b6abba44772 redis (5.4.1) sha256=b5e675b57ad22b15c9bcc765d5ac26f60b675408af916d31527af9bd5a81faae - redis-client (0.26.4) sha256=3ad70beff5da2653e02dfeae996e7d8d7147a558da12b16b2282ad345e4c7120 + redis-client (0.27.0) sha256=00e5918c1ba3fcd54b28e7be24b36fbf7b073e842c3c021ac072173c3eac42bd redis-rack-cache (2.2.1) sha256=9c72978a6354e02efeb2f933dd32c94a4a13f1137dac492442126bf25cc19970 redis-store (1.11.0) sha256=edc4f3e239dcd1fdd9905584e6b1e623a84618e14436e6e8a07c70891008eda4 regexp_parser (2.11.3) sha256=ca13f381a173b7a93450e53459075c9b76a10433caadcb2f1180f2c741fc55a4 @@ -753,4 +761,4 @@ CHECKSUMS webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131 BUNDLED WITH - 4.0.5 + 2.7.2 diff --git a/config/environments/test.rb b/config/environments/test.rb index 26b69ebc4..2d19269bd 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,31 +1,16 @@ # conig file for unit tests -# GOO_BACKEND_NAME = ENV.include?("GOO_BACKEND_NAME") ? ENV["GOO_BACKEND_NAME"] : "AG" -# GOO_HOST = ENV.include?("GOO_HOST") ? ENV["GOO_HOST"] : "localhost" -# GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QUERY"] : "/repositories/bioportal" -# GOO_PATH_DATA = ENV.include?("GOO_PATH_DATA") ? ENV["GOO_PATH_DATA"] : "/repositories/bioportal/statements" -# GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/repositories/bioportal/statements" -# GOO_PORT = ENV.include?("GOO_PORT") ? ENV["GOO_PORT"] : 10035 - -GOO_BACKEND_NAME = ENV.include?("GOO_BACKEND_NAME") ? ENV["GOO_BACKEND_NAME"] : "4store" -GOO_HOST = ENV.include?("GOO_HOST") ? ENV["GOO_HOST"] : "localhost" -GOO_PATH_DATA = ENV.include?("GOO_PATH_DATA") ? ENV["GOO_PATH_DATA"] : "/data/" -GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QUERY"] : "/sparql/" -GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/update/" -GOO_PORT = ENV.include?("GOO_PORT") ? ENV["GOO_PORT"] : 9000 - -MGREP_DICTIONARY_FILE = ENV.include?("MGREP_DICTIONARY_FILE") ? ENV["MGREP_DICTIONARY_FILE"] : "./test/data/dictionary.txt" -MGREP_HOST = ENV.include?("MGREP_HOST") ? ENV["MGREP_HOST"] : "localhost" -MGREP_PORT = ENV.include?("MGREP_PORT") ? ENV["MGREP_PORT"] : 55555 - -REDIS_GOO_CACHE_HOST = ENV.include?("REDIS_GOO_CACHE_HOST") ? ENV["REDIS_GOO_CACHE_HOST"] : "localhost" -REDIS_HTTP_CACHE_HOST = ENV.include?("REDIS_HTTP_CACHE_HOST") ? ENV["REDIS_HTTP_CACHE_HOST"] : "localhost" -REDIS_PERSISTENT_HOST = ENV.include?("REDIS_PERSISTENT_HOST") ? ENV["REDIS_PERSISTENT_HOST"] : "localhost" -REDIS_PORT = ENV.include?("REDIS_PORT") ? ENV["REDIS_PORT"] : 6379 -REPORT_PATH = ENV.include?("REPORT_PATH") ? ENV["REPORT_PATH"] : "./test/ontologies_report.json" -REPOSITORY_FOLDER = ENV.include?("REPOSITORY_FOLDER") ? ENV["REPOSITORY_FOLDER"] : "./test/data/ontology_files/repo" -SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr" -SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr" +GOO_BACKEND_NAME = ENV.include?("GOO_BACKEND_NAME") ? ENV["GOO_BACKEND_NAME"] : "4store" +GOO_HOST = ENV.include?("GOO_HOST") ? ENV["GOO_HOST"] : "localhost" +GOO_PATH_DATA = ENV.include?("GOO_PATH_DATA") ? ENV["GOO_PATH_DATA"] : "/data/" +GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QUERY"] : "/sparql/" +GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/update/" +GOO_PORT = ENV.include?("GOO_PORT") ? ENV["GOO_PORT"] : 9000 +MGREP_HOST = ENV.include?("MGREP_HOST") ? ENV["MGREP_HOST"] : "localhost" +MGREP_PORT = ENV.include?("MGREP_PORT") ? ENV["MGREP_PORT"] : 55556 +REDIS_HOST = ENV.include?("REDIS_HOST") ? ENV["REDIS_HOST"] : "localhost" +REDIS_PORT = ENV.include?("REDIS_PORT") ? ENV["REDIS_PORT"] : 6379 +SEARCH_SERVER_URL = ENV.include?('SEARCH_SERVER_URL') ? ENV['SEARCH_SERVER_URL'] : 'http://localhost:8983/solr' LinkedData.config do |config| config.goo_backend_name = GOO_BACKEND_NAME.to_s @@ -34,16 +19,15 @@ config.goo_path_query = GOO_PATH_QUERY.to_s config.goo_path_data = GOO_PATH_DATA.to_s config.goo_path_update = GOO_PATH_UPDATE.to_s - config.goo_redis_host = REDIS_GOO_CACHE_HOST.to_s + config.goo_redis_host = REDIS_HOST.to_s config.goo_redis_port = REDIS_PORT.to_i - config.http_redis_host = REDIS_HTTP_CACHE_HOST.to_s + config.http_redis_host = REDIS_HOST.to_s config.http_redis_port = REDIS_PORT.to_i - config.search_server_url = SOLR_TERM_SEARCH_URL.to_s - config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s - #config.enable_notifications = false + config.search_server_url = SEARCH_SERVER_URL.to_s + config.property_search_server_url = SEARCH_SERVER_URL.to_s # Ontology analytics - config.ontology_analytics_redis_host = REDIS_PERSISTENT_HOST.to_s + config.ontology_analytics_redis_host = REDIS_HOST.to_s config.ontology_analytics_redis_port = REDIS_PORT.to_i config.ontology_analytics_redis_field = 'test_analytics' config.oauth_providers = { @@ -67,7 +51,7 @@ end Annotator.config do |config| - config.annotator_redis_host = REDIS_PERSISTENT_HOST.to_s + config.annotator_redis_host = REDIS_HOST.to_s config.annotator_redis_port = REDIS_PORT.to_i config.mgrep_host = MGREP_HOST.to_s config.mgrep_port = MGREP_PORT.to_i @@ -75,12 +59,11 @@ end LinkedData::OntologiesAPI.config do |config| - config.http_redis_host = REDIS_HTTP_CACHE_HOST.to_s + config.http_redis_host = REDIS_HOST.to_s config.http_redis_port = REDIS_PORT.to_i end NcboCron.config do |config| - config.redis_host = REDIS_PERSISTENT_HOST.to_s + config.redis_host = REDIS_HOST.to_s config.redis_port = REDIS_PORT.to_i -# config.ontology_report_path = REPORT_PATH end diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index aa1145240..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,150 +0,0 @@ -x-app: &app - build: - context: . - args: - RUBY_VERSION: '3.2' - # Increase the version number in the image tag every time Dockerfile or its arguments is changed - image: ontologies_api:0.0.6 - environment: &env - BUNDLE_PATH: /srv/ontoportal/bundle - # default bundle config resolves to /usr/local/bundle/config inside of the container - # we are setting it to local app directory if we need to use 'bundle config local' - BUNDLE_APP_CONFIG: /srv/ontoportal/ontologies_api/.bundle - COVERAGE: 'true' - GOO_REDIS_HOST: redis-ut - REDIS_GOO_CACHE_HOST: redis-ut - REDIS_HTTP_CACHE_HOST: redis-ut - REDIS_PERSISTENT_HOST: redis-ut - REDIS_PORT: 6379 - SOLR_TERM_SEARCH_URL: http://solr-ut:8983/solr - SOLR_PROP_SEARCH_URL: http://solr-ut:8983/solr - MGREP_HOST: mgrep-ut - MGREP_PORT: 55556 - stdin_open: true - tty: true - command: "bundle exec rackup -o 0.0.0.0 --port 9393" - ports: - - 9393:9393 - volumes: - # bundle volume for hosting gems installed by bundle; it helps in local development with gem udpates - - bundle:/srv/ontoportal/bundle - # api code - - .:/srv/ontoportal/ontologies_api - # mount directory containing development version of the gems if you need to use 'bundle config local' - #- /Users/alexskr/ontoportal:/Users/alexskr/ontoportal - depends_on: &depends_on - solr-ut: - condition: service_healthy - redis-ut: - condition: service_healthy - mgrep-ut: - condition: service_healthy - -services: - api: - <<: *app - environment: - <<: *env - GOO_BACKEND_NAME: 4store - GOO_PORT: 9000 - GOO_HOST: 4store-ut - GOO_PATH_QUERY: /sparql/ - GOO_PATH_DATA: /data/ - GOO_PATH_UPDATE: /update/ - profiles: - - 4store - depends_on: - <<: *depends_on - 4store-ut: - condition: service_started - - api-agraph: - <<: *app - environment: - <<: *env - GOO_BACKEND_NAME: ag - GOO_PORT: 10035 - GOO_HOST: agraph-ut - GOO_PATH_QUERY: /repositories/ontoportal_test - GOO_PATH_DATA: /repositories/ontoportal_test/statements - GOO_PATH_UPDATE: /repositories/ontoportal_test/statements - profiles: - - agraph - depends_on: - <<: *depends_on - agraph-ut: - condition: service_healthy - - redis-ut: - image: redis - healthcheck: - test: redis-cli ping - interval: 10s - timeout: 3s - retries: 10 - - 4store-ut: - image: bde2020/4store - platform: linux/amd64 - #volume: fourstore:/var/lib/4store - command: > - bash -c "4s-backend-setup --segments 4 ontoportal_kb - && 4s-backend ontoportal_kb - && 4s-httpd -D -s-1 -p 9000 ontoportal_kb" - profiles: - - 4store - - solr-ut: - image: solr:8 - volumes: - - ./test/solr/configsets:/configsets:ro - ports: - - "8983:8983" - command: > - bash -c "precreate-core term_search_core1 /configsets/term_search - && precreate-core prop_search_core1 /configsets/property_search - && solr-foreground" - healthcheck: - test: [ "CMD-SHELL", "curl -sf http://localhost:8983/solr/term_search_core1/admin/ping?wt=json | grep -iq '\"status\":\"OK\"}' || exit 1" ] - start_period: 5s - interval: 10s - timeout: 5s - retries: 5 - - mgrep-ut: - image: ontoportal/mgrep:0.0.2 - platform: linux/amd64 - healthcheck: - test: ["CMD", "nc", "-z", "-v", "127.0.0.1", "55556"] - start_period: 3s - interval: 10s - timeout: 5s - retries: 5 - - agraph-ut: - image: franzinc/agraph:v8.3.1 - platform: linux/amd64 - environment: - - AGRAPH_SUPER_USER=test - - AGRAPH_SUPER_PASSWORD=xyzzy - shm_size: 1g - # ports: - # - 10035:10035 - command: > - bash -c "/agraph/bin/agraph-control --config /agraph/etc/agraph.cfg start - ; agtool repos create ontoportal_test - ; agtool users add anonymous - ; agtool users grant anonymous root:ontoportal_test:rw - ; tail -f /agraph/data/agraph.log" - healthcheck: - test: ["CMD-SHELL", "agtool storage-report ontoportal_test || exit 1"] - start_period: 30s - interval: 20s - timeout: 10s - retries: 10 - profiles: - - agraph - -volumes: - bundle: - diff --git a/rakelib/ontoportal_testkit.rake b/rakelib/ontoportal_testkit.rake new file mode 100644 index 000000000..7f04305c0 --- /dev/null +++ b/rakelib/ontoportal_testkit.rake @@ -0,0 +1,2 @@ +# Loads shared OntoPortal testkit rake tasks into this component. +require "ontoportal/testkit/tasks" From e55492ce65b87f0a57211486b61c798738ca780a Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Fri, 6 Mar 2026 18:38:08 -0800 Subject: [PATCH 2/3] update test config file --- config/environments/test.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 2d19269bd..a24789165 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -55,7 +55,6 @@ config.annotator_redis_port = REDIS_PORT.to_i config.mgrep_host = MGREP_HOST.to_s config.mgrep_port = MGREP_PORT.to_i - config.mgrep_dictionary_file = MGREP_DICTIONARY_FILE.to_s end LinkedData::OntologiesAPI.config do |config| From 6521ffecd26303fe764c5b48c599766ce7e587fd Mon Sep 17 00:00:00 2001 From: Alex Skrenchuk Date: Sat, 7 Mar 2026 00:42:46 -0800 Subject: [PATCH 3/3] remove TESTOPTS env var --- .github/workflows/testkit-unit-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/testkit-unit-tests.yml b/.github/workflows/testkit-unit-tests.yml index b5fe5ba83..fb5d5d98f 100644 --- a/.github/workflows/testkit-unit-tests.yml +++ b/.github/workflows/testkit-unit-tests.yml @@ -64,7 +64,6 @@ jobs: - name: Run unit tests env: CI: "true" - TESTOPTS: "-v" BACKEND: ${{ matrix.backend }} run: | MODE="${OPTK_CI_RUN_MODE:-container}"