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 tests #1198
Fix tests #1198
Conversation
Hello, To be transparent we are not great at test now. It is something that has to be improved all the way though. We keep it aside now (don't worry if not merged quickly). I've set up milestones about some opened PR that may need to be included in the test sequence as well. Please let us know your feelings about this, if there's not much extra work for you to check and add them. I understand if it's not in your priorities/perimeter. Regards |
This PR is only fixing exiting tests, to hopefully spare others the time spent searching why they are failing only to realise that it's not their local dev-env's fault but the tests are simply broken to begin with. That being said I just rebased this onto master, and while the the tests still run some are now failing because #1089 broke stuff; namely the exceptions on DELETE caused by |
I agree with you, but the project is not yet prepared for such things. Tests should be here to ensure that nothing breaks. But as you could probably see there is no rule about formatting or testing, or even cleanly providing good git PR. We will probably focus on this aspect at some point. I'll try the test soon and propose a corrective PR afterwards. Thanks. |
Now all tests pass again. |
The Dockerfile did not work as is, because the dependencies in requirements.txt are newer than the stretch-image with its python v3.5 can support/run. Use stable debian with the lts nodejs instead, plus had to add some libs to make the wheel build succeed. jsonschema v4 breaks things, so its version needs to be pinned until bravado is fixed [0]. [0] https://github.com/Yelp/bravado-core/pull/385/files#r731674447
Increased the version of pytest to make it work with py 3.10 [0]. The GET calls no longer return list but the object itself, fixed the tests and assertions to account for that. The tests did not account for the later added `allow_user_remove_domain` setting. And there were issues with missing and non-stopped patchers/mocks. Now all tests are at least passing. [0] pytest-dev/pytest#8540
PR #1089 is the culprit, as was already predicted in the review.
The `unit/apikey` directory is removed because it does not contain any tests. Same for `unit/test_decorators.py`. The `fixture` module is renamed to the special-name `conftest` [0] so they are available in all tests without the need to import them. With that in place, I removed all now unneeded or previously already unused imports from the tests. Also removed that wierd `sys.path` bit from `unit/zone/test_admin_apikey.py`, no idea what that was originally intended for. [0] https://docs.pytest.org/en/6.2.x/fixture.html#conftest-py-sharing-fixtures-across-multiple-files
Rebased onto master, and added a new commit to cleanup a few things. CleanupThe |
This PR is superseded by PR 1339 so I'm closing it. |
The tests were in a sad state, and still are. But at least they run and pass again.
Fix test docker
The Dockerfile did not work as is, because the dependencies in
requirements.txt
are newer than the stretch-image with its python v3.5 can support/run. Use stable debian with the lts nodejs instead, plus had to add some libs to make the wheel build succeed.jsonschema v4 breaks things, so its version needs to be pinned until bravado is fixed.
Fix tests
Increased the version of pytest to make it work with py 3.10.
The GET calls no longer return list but the object itself, fixed the tests and assertions to account for that. The tests did not account for the later added
allow_user_remove_domain
setting. And there were issues with missing and non-stopped patchers/mocks.