ncbo / ontologies_api

Hypermedia API for NCBO's ontology-related projects
http://data.bioontology.org
Other
25 stars 10 forks source link

merge docker based unit testing / github actions #79

Closed alexskr closed 2 years ago

alexskr commented 2 years ago

merge github actions/docker based unit test workflow to master branch

syphax-bouazzouni commented 2 years ago

Hi @alexskr , Thank you for your work, we were waiting for this (full docker testing) at Agroportal for a while. And i have some questions and feedback about this.

We at Agroportal/SIFRportal want to use the run-unit-tests.sh locally for our testing because it's fully Dockernized, but we are overflowed by unrelated logs (see screenshot below), so our first feedback is to add the possibility to hide the logs of SOLR, REDIS, 4STORE. image

Then with your new docker-compose+bash script you are some how deprecating the old run_tests.rb script (that use docker for only 4store/Alegrograph + redis but not containing SOLR), but the old run_tests.rb have some options that you can add to run-unit-tests.sh:

  1. -b, --backend [4store | ag] : An optional backend name to use . Default: 4store
  2. -f, --file TEST_FILE_PATH : An optional path to a test file to be run. Default: all test files
  3. -t, --test TEST_NAME : An optional name of the test to be run. Default: all tests

For the case of the script docker_infrastructure.rb, is it used some where ?

Finally, you have implemented this for ontologies_linked_data than now for ontologies_api, but are you planning to do the same for GOO ? ( P.S: are the goo tests even working ? see https://github.com/ontoportal-lirmm/goo/issues/9)

jvendetti commented 2 years ago

I can offer some background information with regard to the goo unit tests, which haven't worked for a very long time. I once asked the original developer of the library why he had stopped maintaining the unit test code. He told me that as long as the unit tests for ontologies_api and ontologies_linked_data (which both make heavy use of goo) are passing, that he considered it a sufficient indication that goo was functioning as intended.

However, since the original developer of goo is no longer at Stanford and we don't have the benefit of his expertise, I don't necessarily agree with that philosophy. I've felt for a while now that we should resurrect and repair the tests.

I was actually looking at the tests this week, specifically because I see that we have a pull request from you against this library. I made some progress with fixing a number of the tests (https://github.com/ncbo/goo/commits?author=jvendetti&since=2022-03-01&until=2022-03-04) but there are still failures:

➜  goo git:(master) bundle exec rake TESTOPTS="-v"

...

Finished tests in 260.131960s, 0.0577 tests/s, 0.2883 assertions/s.
15 tests, 75 assertions, 28 failures, 0 errors, 8 skips

I'm not implying that we wouldn't accept pull requests against goo without passing unit tests. Rather, I just wanted to communicate the background information I had, and let you know some progress was made with fixing tests.

alexskr commented 2 years ago

docker-compose based unit testing is a work in progress and I do agree that the output is noisy so I will be fixing that in the near future.

we will probably refactor run_tests.rb to use a newer docker-compose approach after we add AllegroGraph to it but for the time being please feel free to use the bash script.

docker_infrastructure.rb is a previous attempt at dockerizing unit testing which we do not use so we would need to clean that up