Skip to content

Commit

Permalink
Implement a bit of sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Jun 1, 2024
1 parent f9d6d91 commit 13f16b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ jobs:

- name: Check failure
run: |
if [[ "${{ steps.failing.outcome }}" != "failure" ]]; then
if [[ "${{ steps.nonexistent_test_dir.outcome }}" != "failure" ]]; then
echo "Test did not fail correctly"
exit 1
fi
if [[ "${{ steps.failing.outputs.failure-reason }}" != "no-tests" ]]; then
if [[ "${{ steps.nonexistent_test_dir.outputs.failure-reason }}" != "no-tests" ]]; then
echo "::error:: failure-reason not set correctly"
exit 1
fi
Expand All @@ -105,7 +105,7 @@ jobs:

- name: Test
uses: ./terraform-test
id: nonexistent_test_dir
id: faulty_filter
continue-on-error: true
with:
path: tests/workflows/test-test/local
Expand All @@ -115,12 +115,12 @@ jobs:
- name: Check failure
run: |
if [[ "${{ steps.failing.outcome }}" != "failure" ]]; then
if [[ "${{ steps.faulty_filter.outcome }}" != "failure" ]]; then
echo "Test did not fail correctly"
exit 1
fi
if [[ "${{ steps.failing.outputs.failure-reason }}" != "no-tests" ]]; then
if [[ "${{ steps.faulty_filter.outputs.failure-reason }}" != "no-tests" ]]; then
echo "::error:: failure-reason not set correctly"
exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions image/entrypoints/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function test() {
if [[ $TEST_EXIT -eq 0 ]]; then
# Workaround a bit of stupidity in the terraform test command
if grep -q "Success! 0 passed, 0 failed." "$STEP_TMP_DIR/terraform_test.stdout"; then
error_log "No tests found"
set_output failure-reason no-tests
exit 1
fi
Expand Down

0 comments on commit 13f16b9

Please sign in to comment.