-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Actions: Create initial integration test for default filters #19239
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
Actions: Create initial integration test for default filters #19239
Conversation
… spaces Quote the paths to the CodeQL CLI dist or autobuild scripts when invoked. This unblocks integration testing, since our integration tests always use a CLI with a space in its directory name.
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.
Pull Request Overview
This PR introduces an initial integration test for default filter behavior and verifies that autobuild invocations work correctly when the CLI path contains spaces.
- Added a Python integration test that sets up a CodeQL database.
- Created an unreachable workflow YAML to simulate non-reachable workflows.
- Defined a composite action and a workflow file under .github for default filter testing.
Reviewed Changes
Copilot reviewed 4 out of 12 changed files in this pull request and generated no comments.
File | Description |
---|---|
actions/ql/integration-tests/filters-default/test.py | Added a simple integration test setting up a CodeQL database |
actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml | Included an unreachable workflow configuration for testing default filters |
actions/ql/integration-tests/filters-default/src/action.yml | Added a composite action file to support the test scenario |
actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml | Added a workflow definition that runs on push events |
Files not reviewed (8)
- actions/extractor/tools/autobuild-impl.ps1: Language not supported
- actions/extractor/tools/autobuild.cmd: Language not supported
- actions/extractor/tools/autobuild.sh: Language not supported
- actions/ql/integration-tests/filters-default/actions.expected: Language not supported
- actions/ql/integration-tests/filters-default/actions.ql: Language not supported
- actions/ql/integration-tests/filters-default/src/.github/action.yaml: Language not supported
- actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml: Language not supported
- actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml: Language not supported
Comments suppressed due to low confidence (1)
actions/ql/integration-tests/filters-default/test.py:1
- Consider adding assertions or validations within the test to confirm that the default filters are correctly applied, ensuring that the integration test exercises the intended behavior.
def test(codeql, actions):
Include a reachable workflow, and several unreachable workflow files. Include action metadata files at various depths, all reachable. This test exercises the default filters when the user doesn't specify paths/paths-ignore.
72a7a6d
to
0bb4ab9
Compare
| src/.github/action.yaml:1:1:11:32 | name: ' ... action' | | ||
| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' | | ||
| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow | | ||
| src/action.yml:1:1:11:32 | name: ' ... action' | |
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.
Is this correct? I was not expecting it to be pulled in.
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.
The autobuild.sh
file includes include:**/action.yml
as a pattern. So, this makes sense.
| src/.github/action.yaml:1:1:11:32 | name: ' ... action' | | ||
| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' | | ||
| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow | | ||
| src/action.yml:1:1:11:32 | name: ' ... action' | |
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.
The autobuild.sh
file includes include:**/action.yml
as a pattern. So, this makes sense.
Thanks for reviews! The test workflow in an internal PR is passing for Linux and macOS but failing for Windows. To unblock further work on the internal and external changes, I'm merging this now and will follow up with fixes. |
specify paths/paths-ignore.
There is currently no integration test workflow for Actions; I will add this in a separate internal PR. Those workflows will only work when there is at least one test case to run.