Skip to content
Open
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
32 changes: 0 additions & 32 deletions .github/workflows/ruby-unit-tests.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/testkit-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker Unit Tests

on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:

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

- name: Checkout ontoportal_testkit
uses: actions/checkout@v4
with:
repository: alexskr/ontoportal_testkit
path: .tooling/ontoportal_testkit

- name: Run unit tests in linux container
env:
CI: "true"
TESTOPTS: "-v"
BACKEND: ${{ matrix.backend }}
run: |
ruby -I .tooling/ontoportal_testkit/lib -e 'require "rake"; require "ontoportal/testkit/tasks"; Rake::Task["test:docker:#{ENV.fetch("BACKEND")}:linux"].invoke'

- 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
9 changes: 9 additions & 0 deletions .ontoportal-testkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
component_name: ncbo_annotator
app_service: test-linux
backends:
- fs
- ag
- vo
- gd
dependency_services:
- mgrep
28 changes: 4 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
ARG RUBY_VERSION=3.1
ARG RUBY_VERSION=3.2
ARG DISTRO=bullseye

FROM ruby:$RUBY_VERSION-$DISTRO

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
libxml2 \
libxslt-dev \
openjdk-11-jre-headless \
raptor2-utils \
&& rm -rf /var/lib/apt/lists/*
ARG TESTKIT_BASE_IMAGE=ontoportal/testkit-base:ruby${RUBY_VERSION}-${DISTRO}
FROM ${TESTKIT_BASE_IMAGE}

WORKDIR /app

# Use a dedicated bundle path
ENV BUNDLE_PATH=/usr/local/bundle
ENV GEM_HOME=/usr/local/bundle
ENV PATH="$BUNDLE_PATH/bin:$PATH"

COPY Gemfile* *.gemspec ./

RUN gem update --system

#I nstall the exact Bundler version from Gemfile.lock (if it exists)
# 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"; \
else \
gem install bundler; \
fi

RUN bundle config set --local path '/usr/local/bundle'
RUN bundle config set --global no-document 'true'
RUN bundle install --jobs 4 --retry 3

COPY . ./
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ group :test do
gem 'pry'
gem 'simplecov'
gem 'simplecov-cobertura' # for codecov.io
gem 'ontoportal_testkit', github: 'alexskr/ontoportal_testkit', branch: 'main'
end

# NCBO gems (can be from a local dev path or from rubygems/git)
Expand Down
19 changes: 14 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
GIT
remote: https://github.com/alexskr/ontoportal_testkit.git
revision: c1eb12818b208f6d9ed46c6793e6115135052f16
branch: main
specs:
ontoportal_testkit (0.1.0)
rake (>= 13.0)

GIT
remote: https://github.com/ncbo/goo.git
revision: 13a8559a2346cc8320d7d36046646907bfa8a27c
revision: f6310650f578200f0e1465bd013dc5a737ef0170
branch: ontoportal-lirmm-development
specs:
goo (0.0.2)
Expand All @@ -18,7 +26,7 @@ GIT

GIT
remote: https://github.com/ncbo/ontologies_linked_data.git
revision: 3204c0a830d344eb9ae1db82c22b46be1ef468b3
revision: 637fdfcfc0f9201a631b4d827d34aa8993325565
branch: chore/ontoportal-lirmm-goo-compat
specs:
ontologies_linked_data (0.0.1)
Expand Down Expand Up @@ -148,7 +156,7 @@ GEM
uri (>= 0.11.1)
net-http-persistent (4.0.8)
connection_pool (>= 2.2.4, < 4)
net-imap (0.6.2)
net-imap (0.6.3)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -245,7 +253,6 @@ PLATFORMS
arm-linux-gnu
arm-linux-musl
arm64-darwin
ruby
x86-linux-gnu
x86-linux-musl
x86_64-darwin
Expand All @@ -263,6 +270,7 @@ DEPENDENCIES
minitest-reporters
oj (~> 3.0)
ontologies_linked_data!
ontoportal_testkit!
parallel
pry
rake
Expand Down Expand Up @@ -327,14 +335,15 @@ CHECKSUMS
net-ftp (0.3.9) sha256=307817ccf7f428f79d083f7e36dbb46a9d1d375e0d23027824de1866f0b13b65
net-http (0.9.1) sha256=25ba0b67c63e89df626ed8fac771d0ad24ad151a858af2cc8e6a716ca4336996
net-http-persistent (4.0.8) sha256=ef3de8319d691537b329053fae3a33195f8b070bbbfae8bf1a58c796081960e6
net-imap (0.6.2) sha256=08caacad486853c61676cca0c0c47df93db02abc4a8239a8b67eb0981428acc6
net-imap (0.6.3) sha256=9bab75f876596d09ee7bf911a291da478e0cd6badc54dfb82874855ccc82f2ad
net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736
netrc (0.11.0) sha256=de1ce33da8c99ab1d97871726cba75151113f117146becbe45aa85cb3dabee3f
oj (3.16.15) sha256=4d3324cac3e8fef54c0fa250b2af26a16dadd9f9788a1d6b1b2098b793a1b2cd
omni_logger (0.1.4) sha256=b61596f7d96aa8426929e46c3500558d33e838e1afd7f4735244feb4d082bb3e
ontologies_linked_data (0.0.1)
ontoportal_testkit (0.1.0)
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
pony (1.13.1) sha256=ab507c8ade8b35de96f1e75c0ae4566a3c40ac8a0d5101433969b6fd29c718a7
Expand Down
25 changes: 16 additions & 9 deletions config/config.test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,27 @@
SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr"
SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr"


LinkedData.config do |config|
config.goo_backend_name = GOO_BACKEND_NAME.to_s
config.goo_host = GOO_HOST.to_s
config.goo_port = GOO_PORT.to_i
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.search_server_url = SOLR_TERM_SEARCH_URL.to_s
config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s
config.goo_backend_name = GOO_BACKEND_NAME.to_s
config.goo_host = GOO_HOST.to_s
config.goo_port = GOO_PORT.to_i
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_HOST.to_s
config.goo_redis_port = REDIS_PORT.to_i
config.http_redis_host = REDIS_HOST.to_s
config.http_redis_port = REDIS_PORT.to_i
config.ontology_analytics_redis_host = REDIS_HOST.to_s
config.ontology_analytics_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
end
Annotator.config do |config|
config.mgrep_host = MGREP_HOST.to_s
config.mgrep_port = MGREP_PORT.to_i
config.mgrep_alt_host = MGREP_HOST.to_s
config.mgrep_alt_port = MGREP_PORT.to_s
config.mgrep_dictionary_file = './test/data/dictionary.txt'
config.annotator_redis_host = REDIS_HOST.to_s
config.annotator_redis_port = REDIS_PORT.to_i
Expand Down
121 changes: 0 additions & 121 deletions docker-compose.yml

This file was deleted.

2 changes: 2 additions & 0 deletions rakelib/ontoportal_testkit.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Loads shared OntoPortal testkit rake tasks into this component.
require "ontoportal/testkit/tasks"
2 changes: 1 addition & 1 deletion test/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

require_relative '../lib/ncbo_annotator'
require_relative '../config/config'
require_relative '../config/config.test'

# Check to make sure you want to run if not pointed at localhost
safe_host = Regexp.new(/localhost|-ut|ncbo-dev*|ncbo-unittest*/)
Expand Down
Loading
Loading