test(env): replace custom scripts with pytest and docker-compose#1178
Merged
max-wittig merged 4 commits intomasterfrom Sep 16, 2020
Merged
test(env): replace custom scripts with pytest and docker-compose#1178max-wittig merged 4 commits intomasterfrom
max-wittig merged 4 commits intomasterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1178 +/- ##
=======================================
Coverage 77.37% 77.37%
=======================================
Files 11 11
Lines 2816 2816
=======================================
Hits 2179 2179
Misses 637 637 Continue to review full report at Codecov.
|
578a2ed to
29488e6
Compare
max-wittig
requested changes
Sep 14, 2020
Member
max-wittig
left a comment
There was a problem hiding this comment.
I'm really a fan of this, just two small comments.
Member
|
@nejch Sadly some conflicts happened. Could you please rebase? |
42a1c84 to
40ec2f5
Compare
Member
Author
I've rebased and refactored those paths with helper fixtures where possible so it's hopefully more readable :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I like writing functional/integration tests because the GitLab API keeps changing so it's the only way to really check the responses are what is assumed in unit test fixtures. But the custom bash scripting in the environment was kind of unreliable with the REUSE_CONTAINER option, the custom venv creation, hardcoded temp dirs (I'm sometimes on a Windows machine 😢 ). It was also not a consistent experience compared to unit tests, so might be why people don't usually add them.
I saw that gitbeaker was doing something similar so I'm hoping this is a stable approach.
The idea was to:
requests-htmldependency andgenerate_token.pypython_test_v4.pyinto real test cases that run independently (though it will make the runs longer I assume)/tmpCons/TODOs before merge:
docker-requirements.txtto avoid polluting other environments, does that make sense?pytest-docker. I have something working locally withpytest_addoptionand there is some work already upstream in Provide fixture for docker cleanup command avast/pytest-docker#51It's also possible this is a bit overkill 😁 but would love any feedback on this if anyone else was also having issues with the bash scripts before.