ontology-access-kit icon indicating copy to clipboard operation
ontology-access-kit copied to clipboard

unify implementation tests into a general compliance test suite

Open cmungall opened this issue 2 years ago • 1 comments

Currently each implementation has its own test suite, and these are not connected.

Thus sql_implementation has a test db file and performs a test for neighbor/ancestor functionality; and pronto_implementation has the same for a slightly different obo file, and slightly different test cases.

We should have

  • a single ontology for testing (that is converted to different forms)
  • a single compliance suite, or one compliance suite per interface

Each implementation can be tested against the full compliance suite. There are known cases where an implementation may not implement something (e.g. some operations are impossible against remote endpoints), these would be annotated with unittest.skip, and we could derive a grid of which implementation can do what for the documentation

cmungall avatar Sep 23 '22 17:09 cmungall

Partially implemented, using a composition rather than inheritance pattern

The main unit tests call the compliance tester:

https://github.com/INCATools/ontology-access-kit/blob/6d29978ac87181d93561d655cb89c9504f59d8f7/tests/test_implementations/test_pronto.py#L72-L73

Example compliance test (shared by implementations/test_foo.py)

https://github.com/INCATools/ontology-access-kit/blob/6d29978ac87181d93561d655cb89c9504f59d8f7/tests/test_implementations/init.py#L30-L47

The actual test class is passed in as an arg, so standard unittest functions are called:

https://github.com/INCATools/ontology-access-kit/blob/6d29978ac87181d93561d655cb89c9504f59d8f7/tests/test_implementations/init.py#L57

cmungall avatar Sep 28 '22 23:09 cmungall