Skip to content

Commit

Permalink
Force failure
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed May 13, 2024
1 parent 4a34e56 commit db20179
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ jobs:
run: ./vendor/bin/phpunit-coverage-check -t 80 clover.xml

- name: Integration tests
if: ${{ (!cancelled()) && (runner.os == 'ubuntu-latest') }}
if: ${{ !cancelled() && matrix.os == 'ubuntu-latest' }}
run: |
# There is one failure (exit with error 2, because some are fixable).
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt
[[ "${PIPESTATUS[0]}" = 2 ]]
[[ "${PIPESTATUS[0]}" = 2 ]] || echo "Error: Expected 2, got ${PIPESTATUS[0]}"
grep -q "PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY" output.txt
# The failure is fixed (exit with error 1, because all fixable ones were fixed).
vendor/bin/phpcbf --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt
[[ "${PIPESTATUS[0]}" = 1 ]]
[[ "${PIPESTATUS[0]}" = 1 ]] || echo "Error: Expected 1, got ${PIPESTATUS[0]}"
grep -q "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" output.txt
# So, there isn't any failure any more (exit without error, aka, 0)
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt
[[ "${PIPESTATUS[0]}" = 0 ]]
[[ "${PIPESTATUS[0]}" = 0 ]] || echo "Error: Expected 0, got ${PIPESTATUS[0]}"
- name: Mark cancelled jobs as failed
if: ${{ cancelled() }}
Expand Down

0 comments on commit db20179

Please sign in to comment.