-
Notifications
You must be signed in to change notification settings - Fork 670
test(env): replace custom scripts with pytest and docker-compose #1178
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
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very very nice!
578a2ed
to
29488e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really a fan of this, just two small comments.
@nejch Sadly some conflicts happened. Could you please rebase? |
42a1c84
to
40ec2f5
Compare
I've rebased and refactored those paths with helper fixtures where possible so it's hopefully more readable :) |
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-html
dependency andgenerate_token.py
python_test_v4.py
into real test cases that run independently (though it will make the runs longer I assume)/tmp
Cons/TODOs before merge:
docker-requirements.txt
to avoid polluting other environments, does that make sense?pytest-docker
. I have something working locally withpytest_addoption
and 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.