feat: Create E2E tests framework using PyTest (#677)#872
Open
1234-ad wants to merge 8 commits intopermitio:masterfrom
Open
feat: Create E2E tests framework using PyTest (#677)#8721234-ad wants to merge 8 commits intopermitio:masterfrom
1234-ad wants to merge 8 commits intopermitio:masterfrom
Conversation
✅ Deploy Preview for opal-docs canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements a comprehensive PyTest-based E2E testing framework for OPAL, addressing issue #677.
Changes
New Files Created
tests/e2e/conftest.py- PyTest configuration and fixturesopal_keys: Generates authentication keys and tokenspolicy_repo: Sets up Gitea and policy repositoryopal_environment: Manages OPAL server/client containerscompose_command: Helper for docker-compose operationstests/e2e/test_opal_e2e.py- Comprehensive test suiteTestOPALHealth: Health endpoint testsTestOPALConnectivity: Server-client connectivity testsTestOPALPolicyUpdates: Policy update tests (single & multiple)TestOPALDataUpdates: Data update tests (single & multiple)TestOPALStatistics: Statistics endpoint verificationTestOPALResilience: Broadcast channel recovery teststests/e2e/README.md- Comprehensive documentationtests/e2e/MIGRATION_GUIDE.md- Migration guide from bashtests/e2e/requirements.txt- Python dependencies.github/workflows/e2e-pytest.yml- CI/CD workflowtests/__init__.pyandtests/e2e/__init__.py- Package initializationFeatures
✅ Complete Test Coverage - All functionality from
app-tests/run.shis covered:✅ Better Maintainability
✅ Enhanced Debugging
✅ Flexible Execution
✅ CI/CD Ready
Testing
The framework has been designed to match all functionality from the existing bash script:
How to Run
Benefits Over Bash Script
Migration Path
The bash script (
app-tests/run.sh) can remain for backward compatibility while teams migrate to PyTest. The migration guide provides detailed mapping between bash functions and PyTest equivalents.Documentation
Closes
Closes #677
Checklist
Additional Notes
This implementation provides a solid foundation for E2E testing that can be easily extended with:
The framework is production-ready and can be integrated into CI/CD pipelines immediately.