diff --git a/.github/workflows/build-and-review-pr.yml b/.github/workflows/build-and-review-pr.yml index d010364..3c57f8a 100644 --- a/.github/workflows/build-and-review-pr.yml +++ b/.github/workflows/build-and-review-pr.yml @@ -606,7 +606,7 @@ jobs: if: always() run: | # Verify the trx-files list matches what we expect - failure="./test/files/failing-test/failure.trx" + failure="./test/files/failing-test-ignore/failure.trx" ./test/assert-values-match.sh --name "trx-files output" --expected "[$failure]" --actual "${{ steps.failing-test.outputs.trx-files }}" # Verify the test-outcome is Failed @@ -631,7 +631,7 @@ jobs: # - The Counter stats are included in the report # - The failure details are included - expectedFileName="./test/files/failing-test/expected-test-results.md" + expectedFileName="./test/files/failing-test-ignore/expected-test-results.md" actualFileName="./test-results.md" ./test/assert-file-contents-match.sh --expectedFileName $expectedFileName --actualFileName $actualFileName @@ -642,7 +642,8 @@ jobs: runs-on: ubuntu-latest env: NO_FAILURES_DIR: './test/files/multiple-trx' - FAILURES_DIR: './test/files/failing-test' + ALLOW_FAILURES_DIR: './test/files/failing-test-allow' + IGNORE_FAILURES_DIR: './test/files/failing-test-ignore' steps: - name: '-------------------------------------------------------------------------------------------------------------' @@ -732,7 +733,7 @@ jobs: uses: ./ with: github-token: '${{ secrets.GITHUB_TOKEN }}' - base-directory: ${{ env.FAILURES_DIR }} + base-directory: ${{ env.IGNORE_FAILURES_DIR }} create-results-file: true # Keep this so we have an "actual" output to compare against create-status-check: true ignore-test-failures: true @@ -764,13 +765,13 @@ jobs: const expectedBody = fs.readFileSync('./test-results.md', 'utf8'); const expectedValues = { - name: 'status check - dotnet unit tests (purposely.failing.tests)', + name: 'status check - dotnet unit tests (ignore.failures)', status: 'completed', conclusion: 'neutral', - title: 'PURPOSELY.FAILING.TESTS', + title: 'IGNORE.FAILURES', text: expectedBody }; - const actualCheck = actualStatusChecks.find(check => check.name.includes('purposely')); + const actualCheck = actualStatusChecks.find(check => check.name.includes('ignore')); assertStatusCheckMatchesExpectations(core, actualCheck, expectedValues); - name: '-------------------------------------------------------------------------------------------------------------' @@ -784,7 +785,7 @@ jobs: uses: ./ with: github-token: '${{ secrets.GITHUB_TOKEN }}' - base-directory: ${{ env.FAILURES_DIR }} + base-directory: ${{ env.ALLOW_FAILURES_DIR }} create-results-file: true # Keep this so we have an "actual" output to compare against create-status-check: true ignore-test-failures: false @@ -816,13 +817,13 @@ jobs: const expectedBody = fs.readFileSync('./test-results.md', 'utf8'); const expectedValues = { - name: 'status check - dotnet unit tests (purposely.failing.tests)', + name: 'status check - dotnet unit tests (allow.failures)', status: 'completed', conclusion: 'failure', - title: 'PURPOSELY.FAILING.TESTS', + title: 'ALLOW.FAILURES', text: expectedBody }; - const actualCheck = actualStatusChecks.find(check => check.name.includes('widget')); + const actualCheck = actualStatusChecks.find(check => check.name.includes('allow')); assertStatusCheckMatchesExpectations(core, actualCheck, expectedValues); - name: '-------------------------------------------------------------------------------------------------------------' diff --git a/test/files/failing-test/expected-test-results.md b/test/files/failing-test-allow/expected-test-results.md similarity index 77% rename from test/files/failing-test/expected-test-results.md rename to test/files/failing-test-allow/expected-test-results.md index 3a00cff..3f68e18 100644 --- a/test/files/failing-test/expected-test-results.md +++ b/test/files/failing-test-allow/expected-test-results.md @@ -1,5 +1,5 @@ -# PURPOSELY.FAILING.TESTS +# Allow.Failures ![Generic badge](https://img.shields.io/badge/1/4-FAILED-red.svg)
@@ -28,19 +28,19 @@
- Outcome: Failed | Total Tests: 4 | Passed: 3 | Failed: 1 + Outcome: Failed | Total Tests: 1 | Passed: 0 | Failed: 1 - + - + - + @@ -49,11 +49,11 @@
Total:41
Executed:41
Passed:30
Failed:
- :x: Purposely.Failing.Tests.MathTests.OnePlusOneShouldNotEqualFive + :x: Allow.Failures.MathTests.OnePlusOneShouldNotEqualFive - + @@ -73,11 +73,11 @@ - + - + @@ -92,4 +92,4 @@
Name:Purposely.Failing.Tests.MathTests.OnePlusOneShouldNotEqualFiveAllow.Failures.MathTests.OnePlusOneShouldNotEqualFive
Outcome:
Code BaseC:\code\widget\bin\Release\net6.0\Purposely.Failing.Tests.dllC:\code\widget\bin\Release\net6.0\Allow.Failures.dll
Class NamePurposely.Failing.Tests.MathTestsAllow.Failures.MathTests
Method Name
StackTrace
-
\ No newline at end of file + diff --git a/test/files/failing-test-allow/failure.trx b/test/files/failing-test-allow/failure.trx new file mode 100644 index 0000000..648c8a7 --- /dev/null +++ b/test/files/failing-test-allow/failure.trx @@ -0,0 +1,40 @@ + + + + + + + + + + + Assert.NotEqual() Failure: Values are equal +Expected: Not 2 +Actual: 2 + at Allow.Failures.MathTests.OnePlusOneShouldNotEqualFive() in C:\code\widget\MathTests.cs:line 19 + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.26] Allow.Failures.MathTests.OnePlusOneShouldNotEqualFive [FAIL] + + + + \ No newline at end of file diff --git a/test/files/failing-test-ignore/expected-test-results.md b/test/files/failing-test-ignore/expected-test-results.md new file mode 100644 index 0000000..17025be --- /dev/null +++ b/test/files/failing-test-ignore/expected-test-results.md @@ -0,0 +1,95 @@ + +# Ignore.Failures + +![Generic badge](https://img.shields.io/badge/1/4-FAILED-red.svg) +
+ Duration: 0.805 seconds + + + + + + + + + + + + + + + + + + + + + +
Start:2024-02-21 20:43:45.719 UTC
Creation:2024-02-21 20:43:46.514 UTC
Queuing:2024-02-21 20:43:46.514 UTC
Finish:2024-02-21 20:43:46.524 UTC
Duration:0.805 seconds
+
+
+ Outcome: Failed | Total Tests: 2 | Passed: 1 | Failed: 1 + + + + + + + + + + + + + + + + + +
Total:2
Executed:2
Passed:1
Failed:1
+
+
+ :x: Ignore.Failures.MathTests.OnePlusOneShouldNotEqualFive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:Ignore.Failures.MathTests.OnePlusOneShouldNotEqualFive
Outcome:Failed
Start:2024-02-21 20:43:46.384 UTC
End:2024-02-21 20:43:46.384 UTC
Duration:00:00:00.0065475
Code BaseC:\code\widget\bin\Release\net6.0\Ignore.Failures.dll
Class NameIgnore.Failures.MathTests
Method NameOnePlusOneShouldNotEqualFive
Error Message:
Message
Stack Trace:
StackTrace
+
diff --git a/test/files/failing-test-ignore/failure.trx b/test/files/failing-test-ignore/failure.trx new file mode 100644 index 0000000..df3531c --- /dev/null +++ b/test/files/failing-test-ignore/failure.trx @@ -0,0 +1,46 @@ + + + + + + + + + + + + Assert.NotEqual() Failure: Values are equal +Expected: Not 2 +Actual: 2 + at Ignore.Failures.MathTests.OnePlusOneShouldNotEqualFive() in C:\code\widget\MathTests.cs:line 19 + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.26] Ignore.Failures.MathTests.OnePlusOneShouldNotEqualFive [FAIL] + + + + \ No newline at end of file diff --git a/test/files/failing-test/failure.trx b/test/files/failing-test/failure.trx deleted file mode 100644 index 1363aa0..0000000 --- a/test/files/failing-test/failure.trx +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - Assert.NotEqual() Failure: Values are equal -Expected: Not 2 -Actual: 2 - at Purposely.Failing.Tests.MathTests.OnePlusOneShouldNotEqualFive() in C:\code\widget\MathTests.cs:line 19 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [xUnit.net 00:00:00.26] Purposely.Failing.Tests.MathTests.OnePlusOneShouldNotEqualFive [FAIL] - - - - \ No newline at end of file