From 941e1d6d175abcaca2d959c1613040fba71a506e Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:23:10 +0100 Subject: [PATCH 1/6] Fail "Validate test" workflow if test runs fail --- .github/workflows/codeql_unit_tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 62660d973..e23377af9 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -39,6 +39,7 @@ jobs: needs: prepare-unit-test-matrix runs-on: ${{ matrix.os }} + continue-on-error: true strategy: fail-fast: false matrix: ${{ fromJSON(needs.prepare-unit-test-matrix.outputs.matrix) }} @@ -163,6 +164,12 @@ jobs: needs: run-test-suites runs-on: ubuntu-22.04 steps: + - name: Check if a dependent job failed to complete + if: ${{ failure() }} + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Test run job failed') - name: Collect test results uses: actions/download-artifact@v3 From 1651c1f30dda8df6f2e8553174b7e89fa1087886 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:24:21 +0100 Subject: [PATCH 2/6] Introduce deliberate compilation error --- .../rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql b/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql index 950302467..06c9274e8 100644 --- a/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql +++ b/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.c.misra import codingstandards.cpp.rules.usageofassemblernotdocumented.UsageOfAssemblerNotDocumented -class UsageOfAssemblyLanguageShouldBeDocumentedQuery extends UsageOfAssemblerNotDocumentedSharedQuery +class UsageOfAssemblyLanguageShouldBeDocumentedQuery UsageOfAssemblerNotDocumentedSharedQuery { UsageOfAssemblyLanguageShouldBeDocumentedQuery() { this = Language2Package::usageOfAssemblyLanguageShouldBeDocumentedQuery() From 8d8fd09c2d3188917d8d1d4ec251c8e8f118ae89 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:26:14 +0100 Subject: [PATCH 3/6] Refactor to try to trigger the failure step --- .github/workflows/codeql_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index e23377af9..a0526551f 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -39,7 +39,6 @@ jobs: needs: prepare-unit-test-matrix runs-on: ${{ matrix.os }} - continue-on-error: true strategy: fail-fast: false matrix: ${{ fromJSON(needs.prepare-unit-test-matrix.outputs.matrix) }} @@ -161,6 +160,7 @@ jobs: validate-test-results: name: Validate test results + if: ${{ always() }} needs: run-test-suites runs-on: ubuntu-22.04 steps: From 37696a908578a78ad32b8b4874deef75f08dbbfd Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:16:44 +0100 Subject: [PATCH 4/6] Updates from editor --- .github/workflows/codeql_unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index a0526551f..41a2990b2 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -164,8 +164,8 @@ jobs: needs: run-test-suites runs-on: ubuntu-22.04 steps: - - name: Check if a dependent job failed to complete - if: ${{ failure() }} + - name: Check if run-test-suites job failed to complete, if so fail + if: ${{ needs.run-test-suites.result == 'failure }} uses: actions/github-script@v3 with: script: | From 37c198ff0cc897a1b546b8694ffe8ee86b1230ac Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:53:26 +0100 Subject: [PATCH 5/6] Updates from editor --- .github/workflows/codeql_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 41a2990b2..5c2bc1073 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -165,7 +165,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check if run-test-suites job failed to complete, if so fail - if: ${{ needs.run-test-suites.result == 'failure }} + if: ${{ needs.run-test-suites.result == 'failure' }} uses: actions/github-script@v3 with: script: | From e9cfc8ebe2284c47ed9858697f6c66dc09cb21fe Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 27 Sep 2024 09:43:01 +0100 Subject: [PATCH 6/6] Revert introduction of CodeQL error --- .../rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql b/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql index 06c9274e8..950302467 100644 --- a/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql +++ b/c/misra/src/rules/DIR-4-2/UsageOfAssemblyLanguageShouldBeDocumented.ql @@ -15,7 +15,7 @@ import cpp import codingstandards.c.misra import codingstandards.cpp.rules.usageofassemblernotdocumented.UsageOfAssemblerNotDocumented -class UsageOfAssemblyLanguageShouldBeDocumentedQuery UsageOfAssemblerNotDocumentedSharedQuery +class UsageOfAssemblyLanguageShouldBeDocumentedQuery extends UsageOfAssemblerNotDocumentedSharedQuery { UsageOfAssemblyLanguageShouldBeDocumentedQuery() { this = Language2Package::usageOfAssemblyLanguageShouldBeDocumentedQuery()