Skip to content

feat: add Python integration tests to CI pipeline#59

Merged
ghaskins merged 8 commits intomanetu:mainfrom
yan-vine:integration-test
Feb 11, 2026
Merged

feat: add Python integration tests to CI pipeline#59
ghaskins merged 8 commits intomanetu:mainfrom
yan-vine:integration-test

Conversation

@yan-vine
Copy link
Contributor

Add pytest-based integration testing infrastructure for PolicyEngine:

  • Add integration-tests job to CI workflow that depends on go-build
  • Download and test built linux-amd64 binary artifacts
  • Create pytest configuration with test markers (unit, integration, smoke, api, grpc)
  • Add shared fixtures for mpe binary, server setup, and test data
  • Include sample tests demonstrating CLI, structure, and API testing patterns
  • Add test runner script with virtual environment management
  • Configure Python dependencies in requirements-test.txt
  • Update .gitignore to exclude Python cache and test artifacts

The integration-tests job runs automatically on push/PR and validates that the built binary works correctly from a client perspective.

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yan-vine yan-vine marked this pull request as draft February 11, 2026 03:06
ghaskins
ghaskins previously approved these changes Feb 11, 2026
@yan-vine yan-vine force-pushed the integration-test branch 2 times, most recently from 0a81443 to b1c20a0 Compare February 11, 2026 16:00
yan-vine and others added 8 commits February 11, 2026 13:03
Add pytest-based integration testing infrastructure for PolicyEngine:

- Add integration-tests job to CI workflow that depends on go-build
- Download and test built linux-amd64 binary artifacts
- Create pytest configuration with test markers (unit, integration, smoke, api, grpc)
- Add shared fixtures for mpe binary, server setup, and test data
- Include sample tests demonstrating CLI, structure, and API testing patterns
- Add test runner script with virtual environment management
- Configure Python dependencies in requirements-test.txt
- Update .gitignore to exclude Python cache and test artifacts

The integration-tests job runs automatically on push/PR and validates
that the built binary works correctly from a client perspective.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Add two new test cases to verify CI pipeline automation:
- test_mpe_help_command: Validates mpe --help output and available commands
- test_policy_domain_structure: Validates YAML structure of PolicyDomain files

These tests ensure the binary works correctly and policy files are well-formed.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Improve the integration-tests CI job to provide detailed test metrics:
- Generate JUnit XML report for test results
- Parse and display test counts in GitHub Actions summary
- Show total tests, passed, and failed counts
- Add pytest-report.xml to artifacts for debugging
- Update .gitignore to exclude pytest artifacts

This enables better visibility into the 110 integration tests that validate
MPE CLI functionality, PolicyDomain configurations, and error handling.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Fix the project root path calculation in _resolve_mpe_binary().
The function was using parents[1] which only went up one level from
tests/utils/mpe_runner.py to tests/, but it needs parents[2] to reach
the actual project root where target/mpe is located.

This fixes the FileNotFoundError in CI where tests couldn't find the
mpe binary.

Tested: All 110 integration tests pass locally.
Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Enable Allure report generation and artifact upload:
- Add --alluredir=allure-results flag to pytest command
- Include allure-results/ in pytest-results artifact
- Update .gitignore to exclude allure-results/ and allure-report/

This provides rich test reports with detailed test execution information,
attachments, and historical data for the 110 integration tests.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Enhance Allure reporting to generate browsable HTML reports:
- Add simple-borg/allure-report-action to generate HTML reports
- Keep 20 historical reports for trend analysis
- Upload complete HTML report as separate 'allure-report' artifact
- Add Allure report link to GitHub Actions summary
- Update .gitignore to exclude allure-history/

The Allure report can be downloaded from artifacts and opened in
a browser to view detailed test results, timelines, graphs, and
historical trends for all 110 integration tests.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
Replace simple-borg/allure-report-action (which doesn't exist) with
manual Allure CLI installation and report generation:
- Download and install Allure 2.24.0
- Generate HTML report with 'allure generate'
- Upload allure-report/ directory as artifact

This fixes the 'repository not found' error and provides the same
functionality - browsable HTML test reports.

Signed-off-by: Yusuf Nathani <yusuf.nathani@sysvine.com>
@yan-vine yan-vine marked this pull request as ready for review February 11, 2026 18:11
@yan-vine yan-vine requested a review from ghaskins February 11, 2026 18:11
@ghaskins ghaskins merged commit fca0d13 into manetu:main Feb 11, 2026
17 checks passed
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