Skip to content

Setup github ci for pytest tests including static analysis#19

Merged
jakub-vavra-cz merged 3 commits intoRedHat-SP-Security:masterfrom
jakub-vavra-cz:githubci
Nov 11, 2025
Merged

Setup github ci for pytest tests including static analysis#19
jakub-vavra-cz merged 3 commits intoRedHat-SP-Security:masterfrom
jakub-vavra-cz:githubci

Conversation

@jakub-vavra-cz
Copy link
Contributor

@jakub-vavra-cz jakub-vavra-cz commented Nov 10, 2025

Summary by Sourcery

Set up GitHub Actions workflows for pytest system tests and static analysis and update pytest configurations accordingly

CI:

  • Add CI workflow to run pytest system tests in containers with artifact collection and Polarion integration
  • Add static code analysis workflow to run flake8, pycodestyle, isort, black, and mypy on schedule and pull requests

Tests:

  • Replace provisioned_topologies entries in mhc.yaml with bareclient, bareipa, and bareldap
  • Remove BareIPA topology marker from test_sudo__refresh_random_offset

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 10, 2025

Reviewer's Guide

Configure GitHub Actions to run containerized system tests, add a scheduled static code analysis workflow for pytest tests, and adjust pytest configurations to align topologies and marks.

Flow diagram for static code analysis workflow steps

flowchart TD
  Start["Start Workflow"]
  Checkout["Checkout Repository"]
  Venv["Setup Virtual Environment"]
  InstallDeps["Install Dependencies"]
  Flake8["Run flake8"]
  Pycodestyle["Run pycodestyle"]
  Isort["Run isort"]
  Black["Run black"]
  Mypy["Run mypy"]
  End["End Workflow"]

  Start --> Checkout --> Venv --> InstallDeps --> Flake8 --> Pycodestyle --> Isort --> Black --> Mypy --> End
Loading

File-Level Changes

Change Details Files
Configure CI workflow for unit and system tests via GitHub Actions
  • Define pytest job matrix for Fedora containers and set concurrency
  • Checkout sssd-test-framework and sudo-tests repositories with full history
  • Set up SSSD containers, patch SSH configuration, and install system test dependencies
  • Install test framework, remove AD entries from mhc.yaml, and run pytest in collect and full test modes
  • Upload test artifacts on completion
.github/workflows/ci.yml
Add static code analysis workflow
  • Trigger on push, pull_request, and daily schedule with concurrency controls
  • Prepare virtual environment and install flake8, pycodestyle, isort, black, and mypy
  • Run each static analysis tool with check-only flags
  • Fail the result job if any analysis step fails
.github/workflows/static-code-analysis.yml
Update pytest test configurations
  • Replace provisioned_topologies entries with bareclient, bareipa, and bareldap
  • Remove redundant pytest.mark.topology(BareIPA) decorator
pytest/mhc.yaml
pytest/tests/test_sudo.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jakub-vavra-cz jakub-vavra-cz force-pushed the githubci branch 13 times, most recently from 039677a to 5910093 Compare November 10, 2025 13:33
@jakub-vavra-cz jakub-vavra-cz marked this pull request as ready for review November 11, 2025 07:33
sourcery-ai[bot]

This comment was marked as resolved.

Copy link

@shridhargadekar shridhargadekar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jakub-vavra-cz jakub-vavra-cz merged commit 0a30524 into RedHat-SP-Security:master Nov 11, 2025
4 checks passed
@jakub-vavra-cz jakub-vavra-cz deleted the githubci branch November 11, 2025 15:14
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.

2 participants

Comments