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

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/testkit-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -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:<backend>:container` (default)
# - native: run `test:docker:<backend>` 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
8 changes: 8 additions & 0 deletions .ontoportal-testkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
component_name: ontologies_linked_data
app_service: test-container
backends:
- fs
- ag
- vo
- gd
dependency_services: {}
30 changes: 6 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
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 \
libxslt1-dev zlib1g-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

# set default test config
COPY config/config.test.rb config/config.rb

COPY Gemfile* *.gemspec ./

# Copy only the `version.rb` file to prevent missing file errors!
# Copy only the `version.rb` file to prevent missing file errors
COPY lib/ontologies_linked_data/version.rb lib/ontologies_linked_data/

COPY Gemfile* *.gemspec ./

#Install the exact Bundler version from Gemfile.lock (if it exists)
RUN gem update --system && \
if [ -f Gemfile.lock ]; then \
# 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 --global no-document 'true'
RUN bundle install --jobs 4 --retry 3

COPY . ./
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ group :test do
gem 'minitest-reporters'
gem 'mocha', '~> 2.7'
gem 'mock_redis', '~> 0.5'
gem 'ontoportal_testkit', github: 'alexskr/ontoportal_testkit', branch: 'main'
gem 'pry'
gem 'rack-test', '~> 0.6'
gem 'simplecov'
Expand All @@ -41,5 +42,6 @@ end
gem 'goo', github: 'ncbo/goo', branch: 'ontoportal-lirmm-development'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'ontoportal-lirmm-development'


gem 'public_suffix', '~> 5.1.1'
gem 'net-imap', '~> 0.4.18'
30 changes: 10 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
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: 13a8559a2346cc8320d7d36046646907bfa8a27c
Expand Down Expand Up @@ -96,17 +104,10 @@ GEM
logger
faraday-net_http (3.4.2)
net-http (~> 0.5)
ffi (1.17.3)
ffi (1.17.3-aarch64-linux-gnu)
ffi (1.17.3-aarch64-linux-musl)
ffi (1.17.3-arm-linux-gnu)
ffi (1.17.3-arm-linux-musl)
ffi (1.17.3-arm64-darwin)
ffi (1.17.3-x86-linux-gnu)
ffi (1.17.3-x86-linux-musl)
ffi (1.17.3-x86_64-darwin)
ffi (1.17.3-x86_64-linux-gnu)
ffi (1.17.3-x86_64-linux-musl)
hashdiff (1.2.1)
htmlentities (4.3.4)
http-accept (1.7.0)
Expand Down Expand Up @@ -292,15 +293,9 @@ GEM

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
activesupport
Expand All @@ -321,6 +316,7 @@ DEPENDENCIES
oj (~> 3.0)
omni_logger
ontologies_linked_data!
ontoportal_testkit!
pony
pry
public_suffix (~> 5.1.1)
Expand Down Expand Up @@ -362,17 +358,10 @@ CHECKSUMS
eventmachine (1.2.7) sha256=994016e42aa041477ba9cff45cbe50de2047f25dd418eba003e84f0d16560972
faraday (2.14.1) sha256=a43cceedc1e39d188f4d2cdd360a8aaa6a11da0c407052e426ba8d3fb42ef61c
faraday-net_http (3.4.2) sha256=f147758260d3526939bf57ecf911682f94926a3666502e24c69992765875906c
ffi (1.17.3) sha256=0e9f39f7bb3934f77ad6feab49662be77e87eedcdeb2a3f5c0234c2938563d4c
ffi (1.17.3-aarch64-linux-gnu) sha256=28ad573df26560f0aedd8a90c3371279a0b2bd0b4e834b16a2baa10bd7a97068
ffi (1.17.3-aarch64-linux-musl) sha256=020b33b76775b1abacc3b7d86b287cef3251f66d747092deec592c7f5df764b2
ffi (1.17.3-arm-linux-gnu) sha256=5bd4cea83b68b5ec0037f99c57d5ce2dd5aa438f35decc5ef68a7d085c785668
ffi (1.17.3-arm-linux-musl) sha256=0d7626bb96265f9af78afa33e267d71cfef9d9a8eb8f5525344f8da6c7d76053
ffi (1.17.3-arm64-darwin) sha256=0c690555d4cee17a7f07c04d59df39b2fba74ec440b19da1f685c6579bb0717f
ffi (1.17.3-x86-linux-gnu) sha256=868a88fcaf5186c3a46b7c7c2b2c34550e1e61a405670ab23f5b6c9971529089
ffi (1.17.3-x86-linux-musl) sha256=f0286aa6ef40605cf586e61406c446de34397b85dbb08cc99fdaddaef8343945
ffi (1.17.3-x86_64-darwin) sha256=1f211811eb5cfaa25998322cdd92ab104bfbd26d1c4c08471599c511f2c00bb5
ffi (1.17.3-x86_64-linux-gnu) sha256=3746b01f677aae7b16dc1acb7cb3cc17b3e35bdae7676a3f568153fb0e2c887f
ffi (1.17.3-x86_64-linux-musl) sha256=086b221c3a68320b7564066f46fed23449a44f7a1935f1fe5a245bd89d9aea56
goo (0.0.2)
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
htmlentities (4.3.4) sha256=125a73c6c9f2d1b62100b7c3c401e3624441b663762afa7fe428476435a673da
Expand Down Expand Up @@ -412,6 +401,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)
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
parser (3.3.10.1) sha256=06f6a725d2cd91e5e7f2b7c32ba143631e1f7c8ae2fb918fc4cebec187e6a688
Expand Down
16 changes: 0 additions & 16 deletions dev/compose/linux/ag.yml

This file was deleted.

3 changes: 0 additions & 3 deletions dev/compose/linux/docker-compose.ci.yml

This file was deleted.

13 changes: 0 additions & 13 deletions dev/compose/linux/fs.yml

This file was deleted.

16 changes: 0 additions & 16 deletions dev/compose/linux/gd.yml

This file was deleted.

13 changes: 0 additions & 13 deletions dev/compose/linux/no-ports.yml

This file was deleted.

16 changes: 0 additions & 16 deletions dev/compose/linux/vo.yml

This file was deleted.

Loading
Loading