From b535e86ea4cefed4523f5d38d7cd9092bd747e0d Mon Sep 17 00:00:00 2001 From: Paul Scarrone Date: Mon, 8 Jul 2024 23:35:54 -0400 Subject: [PATCH 1/2] chore(test): Added smoke test for exclude-glob --- .github/workflows/smoke-tests.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/smoke-tests.yaml b/.github/workflows/smoke-tests.yaml index 3289483..ea1e2db 100644 --- a/.github/workflows/smoke-tests.yaml +++ b/.github/workflows/smoke-tests.yaml @@ -47,6 +47,33 @@ jobs: split-index: 0 - run: echo "The output test suite is ${{ steps.split-tests.outputs.test-suite }}" + smoke-test-exclude-glob: + runs-on: ubuntu-latest + name: Smoke Test Exclude Glob + steps: + - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + repository: eliotsykes/rspec-rails-examples + path: examples/ + - uses: ./ + id: split-tests + name: Run this action + with: + glob: examples/spec/**/*_spec.rb + exclude-glob: examples/spec/api/**/t*_spec.rb + split-total: 5 + split-index: 0 + - run: echo "The output test suite is ${{ steps.split-tests.outputs.test-suite }}" + - run: | + if echo "${{ steps.split-tests.outputs.test-suite }}" | grep -q '/token_spec.rb'; then + echo "token_spec.rb is included in the test-suite, failing the job." + exit 1 + else + echo "token_spec.rb is not included in the test-suite, proceeding." + fi + name: Check for token_spec.rb + smoke-test-line: runs-on: ubuntu-latest name: Smoke Test Line Count From 9dfc57c8a923acd25c817660440ac61ded2f0a34 Mon Sep 17 00:00:00 2001 From: Paul Scarrone Date: Tue, 9 Jul 2024 01:11:09 -0400 Subject: [PATCH 2/2] fix(bash): Fixed quoting to make exclude glob render correctly --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3c361af..0b64483 100644 --- a/action.yml +++ b/action.yml @@ -55,7 +55,7 @@ runs: EXCLUDE_GLOB="" if [ -n "${{ inputs.exclude-glob }}" ]; then - EXCLUDE_GLOB="-exclude-glob='${{ inputs.exclude-glob }}'" + EXCLUDE_GLOB="-exclude-glob=${{ inputs.exclude-glob }}" fi TESTS=$(./split_tests ${SPLIT_BY} -split-index=${{ inputs.split-index }} -split-total=${{ inputs.split-total }} -glob='${{ inputs.glob }}' ${EXCLUDE_GLOB})