-
Notifications
You must be signed in to change notification settings - Fork 674
feat: integrate pytest-gitlab #3313
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
base: main
Are you sure you want to change the base?
Conversation
|
All the existing tests pass when I run |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3313 +/- ##
==========================================
- Coverage 95.75% 90.17% -5.58%
==========================================
Files 98 103 +5
Lines 6051 6425 +374
==========================================
Hits 5794 5794
- Misses 257 631 +374
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
nejch
left a comment
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.
@ptalbert thank you so much for tackling this! I think some of this might need updating to match our current testing environment, since pytest-gitlab was last updated in 2024 from what I can see. It might also help fix the test failures, as we recently also updated that to make it work on GitLab 18.x.
To make that a bit more manageable, would it make sense to split this into smaller PRs - e.g. prepare the changes needed so that the final PR is mostly just copying files? That would make things easier to review as well I think 🙇 thanks!
| services: | ||
| gitlab: | ||
| image: '${GITLAB_IMAGE}:${GITLAB_TAG}' | ||
| image: '${GITLAB_IMAGE:-gitlab/gitlab-ee}:${GITLAB_TAG:-latest}' |
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.
Could we maybe extract the preparation changes (everything that can be applied without moving the plugin) into a separate PR that we merge first? Just so we can focus on integration aspects here. Let me know otherwise I can also try that on my end.
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 didn't realize there was so much drift between the fixtures in pytest-gitlab and python-gitlab fixtures.
To hopefully simplify things, I've redone this PR using the current python-gitlab fixtures as the starting point. It adds the pytest-gitlab plugin but stops short of having the existing tests use any of it. A follow up PR can switch the tests over.
Hopefully this makes more sense. Let me know.
…direnv Signed-off-by: Patrick Talbert <[email protected]>
Take the framework of pytest-gitlab but use the current python-gitlab functional testing fixtures. Signed-off-by: Patrick Talbert <[email protected]>
IMHO this makes it more clear what this is. Signed-off-by: Patrick Talbert <[email protected]>
… is present Signed-off-by: Patrick Talbert <[email protected]>
The previous commit adds a new pytest plugin `pytest-gitlab` but does not (yet) update the existing tests to use it. For now it needs to explicitly be disabled when running tests so it does not interfere with the original fixtures. Since tox now runs the tests with `-p no:gitlab` the test_gitflab_plugin_is_loaded test will always fail. Skip it for now and instead ensure the entrypoint is at least there. Signed-off-by: Patrick Talbert <[email protected]>
3711b46 to
5414694
Compare
|
I suppose the codecov report is lighting up because this PR does not actually exercise the gitlab/testing/ code any more. As I see it the options are:
Doing #1 as a temporary solution seems best if we do not want to do #3 yet. #2 would be great but that is a large undertaking. |
Fixes: #3046
This takes the pytest-gitlab plugin from https://gitlab.com/thht_science_software/pytest-gitlab and puts it in gitlab/testing/. It is then exposed as a pytest plugin "gitlab" and the existing tests/ fixtures are removed.