DLR-SC / corpus-annotation-graph-builder

Corpus Annotation Graph builder (CAG) is an architectural framework that employs the build-and-annotate pattern for creating a graph.
MIT License
10 stars 1 forks source link

Update PyTest to cover the new CAG and fix workflow Setup #18

Closed muelldlr closed 1 year ago

muelldlr commented 1 year ago

Rewrite pytests in order to achieve minimum test coverage (for now)

muelldlr commented 1 year ago

I have looked at the existing tests and thanks that it is better to rewrite the tests. Parts of the old tests are reused where possible.

To iterate faster with test cases, the tests can be tested apart from the git workflow with docker-compose. Once the setup is in place, the tests can then be easily adapted for GIT CI.

All tests are executed under tests/. Just have a look at the file tests/test_graph_creator/test_simple_init.py. As you can see, the whole thing is written a bit simpler, so you can quickly write new tests.

The tests can be run with docker-compose up pytest. Give it a try and let me know what you think.

roxanneelbaff commented 1 year ago

The issue we discussed is related to the pipeline when we commit to github (previsously to gitlab) where you refer in your comment "once the setup is in place". as far as I remember thet pytests were there and supposidly running. However, it is good to add how to run these tests into our readme.

roxanneelbaff commented 1 year ago

This issue should be divided into 2 parts:

muelldlr commented 1 year ago

I've set up the GitHub CI already on December last year. See : https://github.com/DLR-SC/corpus-annotation-graph-builder/blob/main/.github/workflows/main.yml. We have even talked about it then...

as far as I remember thet pytests were there and supposidly running. You said recently that the tests never quite worked. Also makes more sense since they were written for an old version of CAG.

roxanneelbaff commented 1 year ago

@muelldlr yes of course I remember this, in december you created a CI for the CAG sample project. AFAIR you set it up for the sample project, right? If yes, I am not discussing here the sample project... This is another matter.

Just to make sure we are on the same page: I am talking about running pytest when we have a git push - the tests were hanging and not running They were running at some point on GitLab whenever there is a git push and they stopped working on GitLab. Now that we moved to GitHub, we can tackle the issue here.

muelldlr commented 1 year ago

yes of course I remember this, in december you created a CI for the CAG sample project. AFAIR you set it up for the sample project, right? If yes, I am not discussing here the sample project... This is another matter.

Not sure what you mean by example project. But from my side, the CI applied to the project in general. As far as I can remember, we had left it deactivated for the time being.

Just to make sure we are on the same page: I am talking about running pytest when we have a git push - the tests were hanging and not running They were running at some point on GitLab whenever there is a git push and they stopped working on GitLab. Now that we moved to GitHub, we can tackle the issue here.

No, that is clear. I only made the local test-setup so that one could quickly write and run new tests. So to speak, as an intermediate step.

The first tests are under tests/test_graph_creator/test_simple_init.py

The pytest are now running on GitHub at workflow dispatch (so you can start the tests manually from the website), pushand at pull request.