-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add ACT CLI pytest wrapper for testing resolve-ci-vars action #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aaronsteers
wants to merge
5
commits into
main
Choose a base branch
from
devin/1755566379-act-cli-pytest-wrapper
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Migrate ACT CLI testing framework from PyAirbyte to resolve-ci-vars-action - Create ActRunner class specifically for testing resolve-ci-vars action - Add comprehensive pytest test scenarios for static inputs, Jinja2 expressions, and trigger types - Include pytest.ini configuration and requirements.txt for dependencies - Add GitHub Actions workflow test-with-pytest-act.yml for CI testing - All 20 tests pass locally with ACT CLI integration This provides a modular Python testing framework for the resolve-ci-vars action using nektos/act CLI with pytest parameterized tests, focusing on local testing first before CI integration. Co-Authored-By: AJ Steers <[email protected]>
Original prompt from AJ Steers
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The ACT CLI install script places the binary in ./bin/act but this directory is not in PATH by default. This fixes the 'command not found' error in CI by adding /home/ubuntu/bin to GITHUB_PATH and exporting it to the current PATH. Local testing confirms all 20 pytest tests still pass. Co-Authored-By: AJ Steers <[email protected]>
The ACT CLI install script installs to ./bin/act (current working directory) not /home/ubuntu/bin when using sudo bash. This fixes the PATH to use /home/ubuntu/repos/resolve-ci-vars-action/bin instead of /home/ubuntu/bin to resolve the 'command not found' error. Local testing confirms all 20 pytest tests still pass. Co-Authored-By: AJ Steers <[email protected]>
- Add comprehensive Python .gitignore covering __pycache__, *.pyc, .pytest_cache, etc. - Include ACT CLI bin/ directory to prevent local testing artifacts - Prevent Python cache files from being committed to the repository Requested by AJ Steers to clean up Python project structure. Co-Authored-By: AJ Steers <[email protected]>
aaronsteers
commented
Aug 19, 2025
tests/test_resolve_ci_vars_action.py
Outdated
Comment on lines
47
to
48
class TestResolveCiVarsAction: | ||
"""Test class for resolve-ci-vars GitHub Action via ACT CLI.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the test class and use simple test functions
- Remove TestResolveCiVarsAction and TestActRunnerEdgeCases classes - Convert all test methods to simple test functions as requested - Move fixtures to module level for shared access - Maintain all existing test scenarios and functionality - All 20 tests continue to pass after refactoring Addresses GitHub comment from @aaronsteers requesting simple functions over test classes. Co-Authored-By: AJ Steers <[email protected]>
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.
feat: Add ACT CLI pytest wrapper for testing resolve-ci-vars action
Summary
This PR migrates and adapts the ACT CLI pytest wrapper from PyAirbyte to create a comprehensive Python testing framework specifically for the resolve-ci-vars GitHub Action. The implementation uses the nektos/act CLI tool to run GitHub Actions locally with pytest parameterized tests, enabling thorough testing of the action across different trigger scenarios, input types, and edge cases.
Key Components:
tests/act_runner.py
: Python wrapper class for ACT CLI with action-specific testing methodstests/test_resolve_ci_vars_action.py
: Comprehensive test scenarios covering static inputs, Jinja2 expressions, and trigger typestests/conftest.py
: Pytest fixtures and configuration for ACT/Docker availability checks.github/workflows/test-with-pytest-act.yml
: CI workflow for automated testingpytest.ini
andrequirements.txt
: Project configuration and dependenciesThe framework tests 20 different scenarios including static input resolution, Jinja2 expression evaluation, various GitHub event triggers (push, PR, workflow_dispatch), and edge cases. All tests currently pass locally in dry-run mode.
Review & Testing Checklist for Human
Critical (High Risk) - 5 items:
dry_run=False
to verify the action actually executes and produces expected outputs (current tests only validate structure)test-action.yml
to ensure coverage alignment and no functional gapsRecommended Local Test Plan:
pip install -r requirements.txt
pytest tests/ -v
dry_run=False
and verify action outputsDiagram
Notes
test-action.yml
Potential Concerns:
dry_run=True
- real execution testing needed