ci: guard empty matrix categories in integration test workflow#2165
Open
musa-asad wants to merge 2 commits into
Open
ci: guard empty matrix categories in integration test workflow#2165musa-asad wants to merge 2 commits into
musa-asad wants to merge 2 commits into
Conversation
443bd54 to
66b2693
Compare
53dfd05 to
9105d88
Compare
9105d88 to
6a58a2f
Compare
Contributor
|
This PR was marked stale due to lack of activity. |
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.
Background
The CloudWatch Agent integration tests run in GitHub Actions. A single workflow (
test-artifacts.yml) generates test matrices: one per platform category (EC2 Linux, Windows, Darwin, ECS, EKS, etc.): and feeds each matrix to a downstream job that spins up the test infrastructure.The workflow supports filtered runs: a human can dispatch it with
test_dir_filterortest_os_filterto run only a subset of tests. When a filter is applied, categories that have no matching tests are reduced to an empty array[].Problem
GitHub Actions requires every matrix to contain at least one entry. When a filtered dispatch empties a category, the downstream job tries to expand
fromJson('[]')as a matrix and fails immediately:The job is never created, the workflow run is marked
failure, and the error message gives no indication that the failure is expected (the filter simply did not match any tests in that category).This affects every matrix-consumer job that lacks an emptiness guard: 15 jobs in total across all platform categories. Unfiltered runs (cron, bot) are not affected because all categories stay populated.
Changes
test-artifacts.yml: one line added per job:When the matrix is empty, the job is cleanly skipped (green checkmark, no error). When the matrix is populated, the guard evaluates to
trueand has no effect.Jobs guarded:
ec2_linux_matrix_0ec2_gpu_matrixec2_linux_onprem_matrixec2_selinux_matrixec2_linux_itar_matrixec2_linux_china_matrixec2_windows_matrixec2_mac_matrixecs_ec2_launch_daemon_matrixecs_fargate_matrixeks_daemon_matrixeks_deployment_matrixec2_performance_matrixec2_windows_performance_matrixec2_stress_matrixec2_windows_stress_matrixeks_addon_matrixAlso fixed:
LinuxOnPremIntegrationTestwas missingStartLocalStackin itsneedslist, causing it to reference a LocalStack output that was not yet available.Testing
Validated on a full PR Test run: 318 jobs pass, no matrix expansion failures.