-
Notifications
You must be signed in to change notification settings - Fork 675
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
…direnv Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
Code is taken from tag v0.3.1.dev0 (8aaa35d2). - remove `__version__.py` file from pytest-gitlab - maintain python-gitlab docker/.env - adjust imports to use `gitlab.testing` instead of `pytest-gitlab` - make `plugin.py` imports relative - add mypy override for `gitlab.testing.*` - create a `testing` optional dependency - add pytest plugin entrypoint `gitlab` - change from single quotes to double quotes (thanks to black formatting) Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
Bring in the changes from cbc613d ('test(functional): switch to new runner registration API'). Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
…ugin Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
IMHO this makes it more clear what this is. Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
… is present Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
|
All the existing tests pass when I run |
Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
It needs to be `module`, not `function`, otherwise there will be a lot of ScopeMismatch errors. Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
These assets are specific to the functional tests of python-gitlab and do not belong as part of the pytest-gitlab plugin. Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3313 +/- ##
===========================================
- Coverage 95.72% 84.21% -11.51%
===========================================
Files 98 103 +5
Lines 6052 6424 +372
===========================================
- Hits 5793 5410 -383
- Misses 259 1014 +755
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!
| - ruby /create_license.rb && /assets/wrapper | ||
| volumes: | ||
| - ${PWD}/tests/functional/fixtures/create_license.rb:/create_license.rb | ||
| - ./create_license.rb:/create_license.rb |
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.
Does this definitely work (i.e. it will be relative to the compose config file) regardless of where the tests are executed from? Just making sure, I know that different compose implementations have different behavior 🙇
We had some issues in the past when we tried to migrate to compose v2, so just wanted to check.
| 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.
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.