Skip to content

ci: guard empty matrix categories in integration test workflow#2165

Open
musa-asad wants to merge 2 commits into
mainfrom
fix/integ-matrix-empty-guard
Open

ci: guard empty matrix categories in integration test workflow#2165
musa-asad wants to merge 2 commits into
mainfrom
fix/integ-matrix-empty-guard

Conversation

@musa-asad

Copy link
Copy Markdown
Contributor

Summary

A filtered workflow_dispatch run of the integration test workflow (one that
sets a test_dir_filter or test_os_filter input) reduces every non-matching
test category to [] via apply_filters. Twelve inline matrix-consumer jobs in
.github/workflows/test-artifacts.yml expand

arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.<cat>_matrix) }}

with no emptiness guard. When the consumed output is [], fromJson('[]') makes
GitHub Actions reject the matrix with "Matrix vector 'arrays' does not contain
any values"
. The affected jobs are never created and the whole run is marked
failure, even though GenerateTestMatrix itself succeeded. Unfiltered (cron/bot)
runs keep every category populated, so the defect is latent until a filtered
dispatch hits it.

Changes

Added a job-level guard

if: ${{ needs.GenerateTestMatrix.outputs.<cat>_matrix != '[]' }}

to each of the 12 inline consumer jobs in .github/workflows/test-artifacts.yml,
using the matching category output per job:

Job Category output
EC2NvidiaGPUIntegrationTest ec2_gpu_matrix
EC2WinIntegrationTest ec2_windows_matrix
EC2DarwinIntegrationTest ec2_mac_matrix
ECSEC2IntegrationTest ecs_ec2_launch_daemon_matrix
ECSFargateIntegrationTest ecs_fargate_matrix
EKSIntegrationTest eks_daemon_matrix
EKSPrometheusIntegrationTest eks_deployment_matrix
PerformanceTrackingTest ec2_performance_matrix
EC2WinPerformanceTest ec2_windows_performance_matrix
StressTrackingTest ec2_stress_matrix
EC2WinStressTrackingTest ec2_windows_stress_matrix
GPUEndToEndTest eks_addon_matrix

This mirrors the existing ec2_linux_matrix_page_count > N guards that already
protect the paginated EC2Linux jobs. When a category is empty the consumer job is
cleanly skipped instead of failing matrix expansion. Unfiltered runs are
unaffected. No Go code changes.

Test Output

Guard count is exactly 12 (one per inline consumer job):

$ grep -c "!= '\[\]'" .github/workflows/test-artifacts.yml
12

The workflow still parses as valid YAML:

$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/test-artifacts.yml')); print('YAML OK')"
YAML OK

The diff adds only the 12 guard lines and nothing else (excerpt):

   EC2NvidiaGPUIntegrationTest:
     needs: [ StartLocalStack, GenerateTestMatrix, OutputEnvVariables ]
+    if: ${{ needs.GenerateTestMatrix.outputs.ec2_gpu_matrix != '[]' }}
     name: ${{ matrix.arrays.wip && '[WIP] ' || '' }}${{matrix.arrays.testName}}
...
   ECSEC2IntegrationTest:
     name: ${{ matrix.arrays.wip && '[WIP] ' || '' }}${{matrix.arrays.testName}}
     runs-on: ubuntu-latest
     needs: [ GenerateTestMatrix, OutputEnvVariables ]
+    if: ${{ needs.GenerateTestMatrix.outputs.ecs_ec2_launch_daemon_matrix != '[]' }}
...
   GPUEndToEndTest:
     name:  ${{matrix.arrays.testName}}
     needs: [ GenerateTestMatrix, OutputEnvVariables ]
+    if: ${{ needs.GenerateTestMatrix.outputs.eks_addon_matrix != '[]' }}

CI Fix: Node.js 24 action runtime migration

GitHub Actions force-migrated several pinned actions off the deprecated Node.js 20
runtime. The deprecated Node.js 20 action SHAs pinned across .github/workflows/
were bumped to the latest Node.js 24-compatible releases to keep CI green.

Action New tag New SHA
actions/checkout v7.0.0 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
actions/setup-go v6.4.0 4a3601121dd01d1626a1e23e37211e3254c1c06c
aws-actions/configure-aws-credentials v6.2.0 e7f100cf4c008499ea8adda475de1042d6975c7b
hashicorp/setup-terraform v4.0.1 dfe3c3f87815947d99a8997f908cb6525fc44e9e
nick-fields/retry v4.0.0 ad984534de44a9489a53aefd81eb77f87c70dc60
docker/build-push-action v7.2.0 f9f3042f7e2789586610d6e8b85c8f03e5195baf
docker/setup-buildx-action v4.1.0 d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5
docker/setup-qemu-action v4.1.0 06116385d9baf250c9f4dcb4858b16962ea869c3

All actions now run on the node24 runtime.

A filtered workflow_dispatch run (e.g. a test_dir_filter or test_os_filter
input) reduces every non-matching test category to [] via apply_filters.
Twelve inline matrix-consumer jobs in test-artifacts.yml expand
arrays: ${{ fromJson(needs.GenerateTestMatrix.outputs.<cat>_matrix) }}
with no emptiness guard, so fromJson('[]') makes GitHub raise
"Matrix vector 'arrays' does not contain any values" and the whole run
fails (the jobs are never created).

Add a job-level if: ${{ needs.GenerateTestMatrix.outputs.<cat>_matrix != '[]' }}
to each of the 12 inline jobs, mirroring the existing
ec2_linux_matrix_page_count > N guards on the paginated EC2Linux jobs.
This makes filtered dispatches safe without affecting unfiltered runs.
@musa-asad musa-asad requested a review from a team as a code owner June 18, 2026 22:03
@musa-asad musa-asad added the ready for testing Indicates this PR is ready for integration tests to run label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for testing Indicates this PR is ready for integration tests to run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant