Skip to content

Commit 432e5d3

Browse files
committed
Add test suite.
Copy the test configurations over from the main ODK repository, and add a script to try seeding and building those configurations using a freshly installed native ODK environment. Also add a GitHub workflow to run that test suite, and another one to run the static checks on Python code.
1 parent a10fc7b commit 432e5d3

35 files changed

+765
-0
lines changed

.github/workflows/code-quality.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Static code quality tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'pyproject.toml'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'src/**'
14+
- 'tests/**'
15+
- 'pyproject.toml'
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
24+
steps:
25+
- name: Check out the repository
26+
uses: actions/checkout@v4
27+
- name: Set up Python
28+
uses: actions/setup-python@v6
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v7
33+
- name: Install Python dependencies
34+
run: uv sync --dev
35+
- name: Code linting
36+
run: uv run ruff check src
37+
- name: Code formatting
38+
run: uv run ruff format --check src
39+
- name: Static type checking
40+
run: uv run mypy src

.github/workflows/seed-tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Seed and build test configurations of the ODK
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
- 'pyproject.toml'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- 'src/**'
14+
- 'tests/**'
15+
- 'pyproject.toml'
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
# We run the seeding tests using a "native" ODK environments;
24+
# those will never be supported on Windows, but they SHOULD
25+
# work on x86 GNU/Linux and both x86 and arm64 macOS.
26+
os: [ ubuntu-latest, macos-15, macos-15-intel ]
27+
steps:
28+
- name: Check out the repository
29+
uses: actions/checkout@v4
30+
- name: Set up Python
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version-file: "pyproject.toml"
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v7
36+
- name: Create dummy Git user name
37+
run: git config --global user.name Alice
38+
- name: Create dummy Git user email
39+
run: git config --global user.email [email protected]
40+
- name: Install Python dependencies
41+
run: uv sync --all-extras
42+
- name: Run the tests
43+
run: cd tests && sh test-config.sh

tests/configs/test-base.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
id: tbase
2+
title: "Test Base"
3+
github_org: INCATools
4+
repo: ontology-development-kit
5+
import_group:
6+
use_base_merging: true
7+
exclude_iri_patterns:
8+
- <http://purl.obolibrary.org/obo/GOCHE_*>
9+
- <http://purl.obolibrary.org/obo/OBA_*>
10+
slme_individuals: exclude
11+
mirror_max_time_download: 400
12+
products:
13+
- id: ro
14+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
15+
- id: pato
16+
use_base: true
17+
# This test cannot be easily replaced, because use_base and custom URL dont mix
18+
- id: pr
19+
make_base: true
20+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/pr_slim.owl

tests/configs/test-branch.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
id: tbranch
2+
title: "Test Branch"
3+
github_org: INCATools
4+
repo: ontology-development-kit
5+
git_main_branch: testbranch

tests/configs/test-ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
id: tci
2+
title: "Test CI"
3+
github_org: INCATools
4+
repo: ontology-development-kit
5+
git_main_branch: master
6+
workflows:
7+
- qc
8+
- diff
9+
ci:
10+
- github_actions
11+
robot_report:
12+
custom_sparql_checks : []
13+
custom_sparql_exports :
14+
- basic-report
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
id: tco
2+
title: "Test Components Make Base Ontology"
3+
github_org: INCATools
4+
repo: ontology-development-kit
5+
release_artefacts:
6+
- full
7+
- simple
8+
primary_release: full
9+
export_formats:
10+
- owl
11+
- json
12+
import_group:
13+
products:
14+
- id: ro
15+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
16+
- id: bfo
17+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/bfo.owl
18+
components:
19+
products:
20+
- filename: pato.owl
21+
source: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/pato.owl
22+
base_iris:
23+
- http://purl.obolibrary.org/obo/PATO_
24+
- http://purl.obolibrary.org/obo/pato#
25+
make_base: true
26+
robot_java_args: '-Xmx8G'
27+
allow_equivalents: asserted-only

tests/configs/test-components.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
id: tco
2+
title: "Test Components Ontology"
3+
github_org: obophenotype
4+
repo: components
5+
report_fail_on: ERROR
6+
use_dosdps: true
7+
dosdp_tools_options: "--obo-prefixes=true --restrict-axioms-to=logical"
8+
release_artefacts:
9+
- base
10+
- full
11+
- simple
12+
primary_release: full
13+
export_formats:
14+
- owl
15+
- obo
16+
- json
17+
import_group:
18+
products:
19+
- id: pato
20+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/pato.owl
21+
- id: ro
22+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
23+
- id: bfo
24+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/bfo.owl
25+
components:
26+
products:
27+
- filename: wbphenotype-equivalent-axioms-subq.owl
28+
robot_java_args: '-Xmx8G'
29+
allow_equivalents: asserted-only
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
id: tdm
2+
title: "Pattern Test Ontology - Matching Pipeline"
3+
github_org: obophenotype
4+
repo: ptt
5+
report_fail_on: ERROR
6+
use_dosdps: TRUE
7+
export_formats:
8+
- owl
9+
- obo
10+
- json
11+
import_group:
12+
products:
13+
- id: ro
14+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
15+
- id: pato
16+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/pato.owl
17+
pattern_pipelines_group:
18+
products:
19+
- id: manual
20+
dosdp_tools_options: "--obo-prefixes=true --restrict-axioms-to=logical"
21+
- id: auto
22+
dosdp_tools_options: "--obo-prefixes=true"
23+
matches:
24+
- id: auto
25+
dosdp_tools_options: "--obo-prefixes=true --restrict-axioms-to=logical"

tests/configs/test-edit-obo.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
id: eto
2+
title: "Test Ontology For using OBO format base"
3+
github_org: obophenotype
4+
repo: eto
5+
report_fail_on: ERROR
6+
edit_format: obo
7+
import_group:
8+
products:
9+
- id: ro
10+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
id: rtgh
2+
title: "Release Test Ontology With GH release"
3+
github_org: obophenotype
4+
repo: rta
5+
report_fail_on: ERROR
6+
namespaces:
7+
- http://purl.obolibrary.org/obo/RTGH_
8+
release_artefacts:
9+
- simple
10+
- base
11+
- full
12+
primary_release: simple
13+
import_group:
14+
products:
15+
- id: ro
16+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/ro.owl
17+
- id: pato
18+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/pato.owl
19+
- id: mpath
20+
mirror_from: https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/tests/ontologies/mpath.owl
21+
public_release: github_curl
22+
public_release_assets:
23+
- rtgh.owl
24+
git_user: matentzn

0 commit comments

Comments
 (0)