-
Notifications
You must be signed in to change notification settings - Fork 671
Optionally keep containers after running integration tests #1478
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
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.
Awesome @benjamb, we lost this when switching from the bash scripts as the cleanup fixture wasnt available in pytest-docker at the time. Was going to get to this but you beat me to it ;)
Just a few tiny comments. BTW, have you tried running the full suites (both API and CLI) a few times in a row to see if our tests actually clean up all resources for consistent results? The functional tests are still in kind of poor shape so I'm not sure. I'll try to play a bit later today but just checking. :) Thanks
Additionally updates token creation to make use of `first_or_create()`, to avoid errors from the script caused by GitLab constraints preventing duplicate tokens with the same value.
I could have sworn I had, though after running the full API tests twice in a row I hit a few errors and have since included some additional fixes to address these on top of this PR. |
This is a feature added in 3.8, removing it allows for the test to run with lower python versions.
Deploy tokens would remain in the instance if the respective project or group was deleted without explicitly revoking the deploy tokens first.
Was incorrectly using the issue 'id' vs 'iid'.
Timing issues between requesting group deletion and GitLab enacting that deletion resulted in errors while attempting to delete a user which was the sole owner of said group (see: test_groups). Pass the 'hard_delete' parameter to ensure user deletion.
While developing tests, waiting for a new GitLab container to spin up every run became a little frustrating, especially given I only wanted to run one file within the suite.
Added an optional flag which may be passed to pytest to keep the containers around after a test run.