Skip to content

Conversation

@ptalbert
Copy link

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.

…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>
@ptalbert
Copy link
Author

All the existing tests pass when I run tox, however, I am struggling to get api_func_v4 and cli_func_v4 to run even on the original main branch. Still working on it...

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
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 60.16484% with 145 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.21%. Comparing base (4221195) to head (3711b46).

Files with missing lines Patch % Lines
gitlab/testing/fixtures/gitlab.py 60.95% 114 Missing ⚠️
gitlab/testing/fixtures/helpers.py 60.97% 16 Missing ⚠️
gitlab/testing/docker/docker.py 40.00% 6 Missing ⚠️
gitlab/testing/fixtures/meta.py 66.66% 6 Missing ⚠️
gitlab/testing/plugin.py 0.00% 3 Missing ⚠️
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     
Flag Coverage Δ
api_func_v4 72.57% <53.29%> (-11.08%) ⬇️
cli_func_v4 67.82% <53.57%> (-10.87%) ⬇️
unit 75.94% <6.59%> (-14.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/testing/plugin.py 0.00% <0.00%> (ø)
gitlab/testing/docker/docker.py 27.77% <40.00%> (ø)
gitlab/testing/fixtures/meta.py 66.66% <66.66%> (ø)
gitlab/testing/fixtures/helpers.py 60.97% <60.97%> (ø)
gitlab/testing/fixtures/gitlab.py 60.95% <60.95%> (ø)

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorporate pytest-gitlab plugin back into python-gitlab

1 participant