Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken tests #156

Merged
merged 20 commits into from
Aug 2, 2024
Merged

Fix broken tests #156

merged 20 commits into from
Aug 2, 2024

Conversation

HarmvZ
Copy link
Member

@HarmvZ HarmvZ commented Jul 26, 2024

Warning: This PR is based on the remove_retina branch

I started by seeing when the tests did pass and if that is still the case currently. Looking at the latest merge it was around june 20 2023 so I started with gc around there (6ef429ae7691afcadfbfae6e1da834ce0e3ba76b), this passes. Then I iterated over some releases to see when the first errors pop up. This happened at cc514a444386d1787a7b4ef5d1395c22e33df07d.

Reason: Faker is added here but not added in poetry. It is available in the test container because it is a dependency of factory-boy, however it is not available in the production container, which is the container used by gcapi to run a local gc in the tests. This needs to be fixed by either adding it in the production container or removing the usage in the fixtures. For now, the easy fix was to "hack it in":

An algorithm with file as input was used in the tests but it is removed here: comic/grand-challenge.org#3140. I've added it back in a local version of algorithm_evaluation_fixtures.py.
Also in that PR, the demo algorithm used in the fixtures is built using docker. Docker is not available in the production container, so in the local version of evaluation fixtures we load the algorithm from the local filesystem.

Functionality for updating CIV interface by uploading existing file is removed here: comic/grand-challenge.org#3156. I've removed the tests and some documentation for this functionality.

At this point the codebase was at the removal of the retina endpoints: comic/grand-challenge.org#3192. This obviously introduced errors because of the missing endpoints. After merging #154, those errors dissapear, except for 2 new errors. Those are fixed by switching a token and removing string interpolation issue.

Then, after updating to the most recent version of gc, there were 2 issues remaining:

  • 1 caused by a deprecated property on the Job model. This could also be fixed by regenerating the models.py file with datamodel-code-generator, but this was an easy fix so I just removed the property.
  • component_interface_value_fixtures.py was missing, added it back.

After all this the tests pass again 🎉

Some of the fixes here are hacky, we need to find a proper solution for them. Also we need to find a proper solution for keeping gcapi up to date with gc because otherwise changes will creep in that we miss here. Then we have broken version of gcapi and run into failing tests when we create a PR here. Maybe the tests here should be run periodically (weekly/bimonthly?) so that we find new errors sooner.

HarmvZ added 18 commits July 25, 2024 13:26
Faker was added on gc in comic/grand-challenge.org#3093, but it was not added to poetry and it is not available in the production container.
Docker is not available in the production container, so we use a local version of evaluation fixtures that loads the container from the local filesystem instead of building it with docker. Also we add another algorithm with a file input for testing.
This functionality is removed in #3156 on grand challenge so the tests are removed here.
@HarmvZ
Copy link
Member Author

HarmvZ commented Jul 29, 2024

It seems there is one flaky test remaining. See this test run: https://github.com/DIAGNijmegen/rse-gcapi/actions/runs/10113674491/attempts/1

I reran the workflow without changing anything and then it passed.

@jmsmkn
Copy link
Member

jmsmkn commented Aug 1, 2024

I think it would be best if we completely decouple the two repositories. These problems pop up often as the Grand Challenge codebase changes a lot, and we do not have automated tests for drifts. I know the tests well so am happy to do that today.

@jmsmkn jmsmkn self-assigned this Aug 1, 2024
gcapi/client.py Outdated Show resolved Hide resolved
HarmvZ and others added 2 commits August 1, 2024 13:59
This updates the supported versions of python, brings the fixture
creation under version control here, removes the static container and
disables a couple of tests as they were broken with the fixtures, will
re-enable those later.
@jmsmkn jmsmkn merged commit 7b11b7a into remove_retina Aug 2, 2024
10 checks passed
@jmsmkn jmsmkn deleted the fix-tests branch August 2, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants