Skip to content

[gitlab] Improve test coverage#379

Open
sondrebr wants to merge 9 commits into
EESSI:gitlabfrom
sondrebr:add-gitlab-support-improve-test-coverage
Open

[gitlab] Improve test coverage#379
sondrebr wants to merge 9 commits into
EESSI:gitlabfrom
sondrebr:add-gitlab-support-improve-test-coverage

Conversation

@sondrebr

@sondrebr sondrebr commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

This PR focuses on improving test coverage for the stuff added in the previous GitLab PRs (#370 and #376). It contains:

  • Tests for
    • connections/gitlab.py
    • tools/git.py
    • tools/commands.py (SUPPORTED_COMMANDS_PER_GIT_HOST and get_supported_commands())
    • tools/event_info.py
  • Sample webhook events for use in tests (stored as JSON files in test/events/)
  • Some fixes and tiny changes

The sample event files are based on webhook events from GitHub and GitLab, with some values changed.
I did however keep (I think) all the fields so they can also be used for reference and tests in the future, for example when adding new EventInfo properties.

Note that this PR does not include any tests for the PRComment classes.
Existing code in tools/pr_comments.py will probably have to be changed a lot when implementing GL support for the rest of the commands, so I think it's better to wait and see if the existing tests can be modified and reused for PRComment tests.

Edit: Addresses issue #375

sondrebr added 9 commits June 22, 2026 14:52
For some reason, `timeout` and `retry_transient_errors` were set
manually after init instead of just being passed as arguments
Also change 'action' to get action from 'event_info' dict instead
of '_object_attributes', to be consistent with 'event_type'
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.

1 participant