You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by po...@apache.org on 2026/07/05 11:25:18 UTC

(magpie) branch main updated: ci(tests): skip the pytest job on an empty matrix instead of failing (#753)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/magpie.git


The following commit(s) were added to refs/heads/main by this push:
     new c6da403c ci(tests): skip the pytest job on an empty matrix instead of failing (#753)
c6da403c is described below

commit c6da403c8fb48ab1299a371f3383bc324b031aa7
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Jul 5 13:25:13 2026 +0200

    ci(tests): skip the pytest job on an empty matrix instead of failing (#753)
    
    The path-filter added in #751 can select zero workspace members (a PR that
    changes no project's Python — e.g. docs / skill / eval-fixture only). An
    empty array fed to a matrix makes GitHub mark the job 'failure' ('matrix
    vector does not contain any values'), not 'skipped', so tests-ok failed the
    PR even though there was legitimately nothing to run (observed on #745).
    
    Guard the pytest job with 'if: needs.members.outputs.members != "[]"' so an
    empty selection skips the job; tests-ok already treats 'skipped' as a pass.
    
    Generated-by: Claude Code (Opus 4.8)
    
    Co-authored-by: Tester <t...@example.com>
---
 .github/workflows/tests.yml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 226d8803..d25bd301 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -146,6 +146,13 @@ jobs:
     name: "pytest (${{ matrix.project.name }})"
     runs-on: ubuntu-latest
     needs: members
+    # Guard against an empty selection. When the path filter selects no
+    # members (a PR that changed no project's Python), the members output
+    # is `[]`; feeding an empty array to `matrix` makes GitHub mark this
+    # job `failure` ("matrix vector does not contain any values"), not
+    # `skipped` — which would fail `tests-ok`. Skipping the job on an
+    # empty list yields the `skipped` result `tests-ok` treats as a pass.
+    if: ${{ needs.members.outputs.members != '[]' }}
     permissions:
       contents: read
     strategy: