Skip to content

Commit 39e8bc8

Browse files
authored
Added test caseologue (#7)
* Reorganization of caseologue python: test data moved into a test folder. test_caseologue.py script added in test folder * modification of caseologue (dirpath) * added github actions workflow to run test_caseologue.py + updated readme * added some test data Co-authored-by: Lucie Lamothe <[email protected]>
1 parent 6901851 commit 39e8bc8

28 files changed

+337
-86
lines changed

.github/workflows/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### GitHub Actions workflows for caseologue
22

3-
`build_docs.yml` : will run when a modification occurs in the docs/ directpry of the caseologye.py script. It will trigger the update and deployment of the github page documentation of caseologue.
3+
`build_docs.yml` : will run when a modification occurs in the docs/ folder of the caseologye.py script. It will trigger the update and deployment of the github page documentation of caseologue.
44

55
`caseologue_python.yml`: Is a callable workflow to run the caseologue.py script, running custom SPARQL queries. It cannot be run on it's own, it needs to be called by another workflow. It requires as input the ontology path and optionnaly severity level.
66

@@ -10,4 +10,6 @@
1010

1111
`caseologue_all_tests.yml`: Calls the 3 workflows above (caseologue_python.yml, caseologue_robot_reason.yml, caseologue_robot_report.yml) and run them on the current dev version of EDAM. It can only be run mannualy on the GitHub Actions interface. It runs all test including the one with a "curation" level in caseologue python.
1212

13-
`caseologue_error_essential.yml`: Calls the 3 workflows above (caseologue_python.yml, caseologue_robot_reason.yml, caseologue_robot_report.yml) and run them on the current dev version of EDAM. It is triggered by every push on the caseologue repository and can be run manually on the GitHub Actions interface. For caseologue python, it only runs the test with a "error" and "essential" level.
13+
`caseologue_error_essential.yml`: Calls the 3 workflows above (caseologue_python.yml, caseologue_robot_reason.yml, caseologue_robot_report.yml) and run them on the current dev version of EDAM. It is triggered by every push on the caseologue repository and can be run manually on the GitHub Actions interface. For caseologue python, it only runs the test with a "error" and "essential" level.
14+
15+
`test_caseologue.yml`: runs the test_caseologue.py script in th caseologue_oyhton/test/ folder. It tests that caseologue tests do catch errors in the test data owl files.

.github/workflows/caseologue_python.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- name: run
3636
run: |
3737
cd caseologue_python/
38+
printf "\n_____________________________________________________________________________________________\n\nFollowing debug table can be found as a tsv file at the bottom of the summary of this job\n_____________________________________________________________________________________________"
3839
EDAM_PATH=${{inputs.edam_path}} python3 caseologue.py ${{inputs.caseologue_options}}
3940
4041
# - name: Print output

.github/workflows/test_caseologue.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: test caseologue
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
paths:
8+
- 'caseologue_python/**'
9+
10+
jobs:
11+
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
18+
- uses: actions/checkout@v2
19+
20+
- name: Install requirements
21+
run: |
22+
pip install -r caseologue_python/requirements.txt
23+
- name: run test_caseologue
24+
if: always()
25+
run: |
26+
cd caseologue_python/test/
27+
python3 test_caseologue.py
28+
29+
30+
31+
# duplicate all not tested, too long to run

caseologue_python/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ _____________________________________
4343

4444
3.3. Update the suite() function at the top of the script. According to the error level you chose you will add after the "if curation/error/essential == True" line, a "suite.addTest(EdamQueryTest("XXXXtest_function_nameXXX"))" line. Warning: the test function name should be the same as the one defined in the function you defined just before.
4545

46-
4) **Run the test**
46+
47+
4) **Add test to test_caseologue**
48+
49+
In the main function of test_caseologue.py, add a call of the "test_caseologue" function with the name of your newly added test and the number of expected error from your test data.
50+
51+
5) **Run the test**
4752

4853
First run it with its test data, see README.md in the ./caseologue_python/queries folder. Then test it with the whole EDAM, see README in the ./caseologue_python folder.

0 commit comments

Comments
 (0)