From 4a3c1cf71745fa29374d937004bda05cd182a371 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 06:41:56 +1100 Subject: [PATCH 01/55] Add this branch for testing Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 8ca5d998b46..5282d628113 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main] + branches: [main, upload-test-report] pull_request: branches: [main] From 9d551207169425ff98679a227cb6d0536cd35b27 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 06:49:02 +1100 Subject: [PATCH 02/55] Add checks: write Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 5282d628113..656bb4323c0 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -14,6 +14,7 @@ concurrency: # See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions permissions: # added using https://github.com/step-security/secure-workflows contents: read + checks: write jobs: unit-tests: From 657b39df021ebcb9b2534cbcf0db6cdb7ce66770 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 07:14:07 +1100 Subject: [PATCH 03/55] Add test report workflow Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 41 ++++++++++++++++++++++ .github/workflows/ci-unit-tests.yml | 17 +++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml new file mode 100644 index 00000000000..646ba8503ad --- /dev/null +++ b/.github/workflows/ci-unit-tests-report.yml @@ -0,0 +1,41 @@ +name: Unit Tests Results + +on: + workflow_run: + workflows: ["Unit Tests"] + types: + - completed + +jobs: + unit-tests-results: + name: Unit Tests Results + runs-on: ubuntu-latest + + permissions: + checks: write + + # needed unless run with comment_mode: off + pull-requests: write + + # required by download step to access artifacts API + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@v3 + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" \ No newline at end of file diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 656bb4323c0..8b8bef5df76 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -42,6 +42,13 @@ jobs: check_name: Unit Tests Summary junit_files: junit-report.xml + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: junit-report.xml + - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -53,3 +60,13 @@ jobs: flags: unittests fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} + + event-file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} \ No newline at end of file From fc66fdf7a5b6e48ef0621a86333d8dbecdf808ad Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 08:45:33 +1100 Subject: [PATCH 04/55] Newline Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 2 +- .github/workflows/ci-unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 646ba8503ad..8eb73ba7f46 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -38,4 +38,4 @@ jobs: commit: ${{ github.event.workflow_run.head_sha }} event_file: artifacts/Event File/event.json event_name: ${{ github.event.workflow_run.event }} - files: "artifacts/**/*.xml" \ No newline at end of file + files: "artifacts/**/*.xml" diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 8b8bef5df76..dcd361b4b2c 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -69,4 +69,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: Event File - path: ${{ github.event_path }} \ No newline at end of file + path: ${{ github.event_path }} From e9b082a6ebcbd55214b15f909952b6e6f785112a Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 10:37:04 +1100 Subject: [PATCH 05/55] Singular Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 8eb73ba7f46..8366b5eae8d 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -1,4 +1,4 @@ -name: Unit Tests Results +name: Unit Test Results on: workflow_run: @@ -7,8 +7,8 @@ on: - completed jobs: - unit-tests-results: - name: Unit Tests Results + unit-test-results: + name: Unit Test Results runs-on: ubuntu-latest permissions: From e76188e3729e5eedff52438fcc57a7dfa2e76530 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 10:51:13 +1100 Subject: [PATCH 06/55] Testing workflow_run which only triggers off default branch Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 41 ++++++++++++++++++++++ .github/workflows/ci-unit-tests.yml | 20 ++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml new file mode 100644 index 00000000000..8366b5eae8d --- /dev/null +++ b/.github/workflows/ci-unit-tests-report.yml @@ -0,0 +1,41 @@ +name: Unit Test Results + +on: + workflow_run: + workflows: ["Unit Tests"] + types: + - completed + +jobs: + unit-test-results: + name: Unit Test Results + runs-on: ubuntu-latest + + permissions: + checks: write + + # needed unless run with comment_mode: off + pull-requests: write + + # required by download step to access artifacts API + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@v3 + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 8ca5d998b46..dcd361b4b2c 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main] + branches: [main, upload-test-report] pull_request: branches: [main] @@ -14,6 +14,7 @@ concurrency: # See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions permissions: # added using https://github.com/step-security/secure-workflows contents: read + checks: write jobs: unit-tests: @@ -41,6 +42,13 @@ jobs: check_name: Unit Tests Summary junit_files: junit-report.xml + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: junit-report.xml + - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -52,3 +60,13 @@ jobs: flags: unittests fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} + + event-file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} From d17935d4b2972f6748bd52e56ba53405dcf9fd02 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 10:53:11 +1100 Subject: [PATCH 07/55] comments --- .github/workflows/ci-unit-tests-report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 8366b5eae8d..f3a1a178890 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -14,10 +14,10 @@ jobs: permissions: checks: write - # needed unless run with comment_mode: off + # Needed unless run with comment_mode: off. pull-requests: write - # required by download step to access artifacts API + # Required by download step to access artifacts API. actions: read steps: From 0851215e99ad2db177ee37d91f3ffe3b9b7de783 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 11:14:03 +1100 Subject: [PATCH 08/55] Comments Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 8366b5eae8d..f3a1a178890 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -14,10 +14,10 @@ jobs: permissions: checks: write - # needed unless run with comment_mode: off + # Needed unless run with comment_mode: off. pull-requests: write - # required by download step to access artifacts API + # Required by download step to access artifacts API. actions: read steps: From 57df30e7e41c1f5529cfaca7a439ff03b55baabf Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 22:38:09 +1100 Subject: [PATCH 09/55] Give write PR permission and use actions/download-artifact --- .github/workflows/ci-unit-tests-report.yml | 4 ++-- .github/workflows/ci-unit-tests.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index f3a1a178890..e7ac97b0b29 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -27,9 +27,9 @@ jobs: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: Download and Extract Artifacts - uses: dawidd6/action-download-artifact@v3 + uses: actions/download-artifact@v4 with: - run_id: ${{ github.event.workflow_run.id }} + run-id: ${{ github.event.workflow_run.id }} path: artifacts - name: Publish Test Results diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index dcd361b4b2c..6f8eebbd1bd 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -15,6 +15,7 @@ concurrency: permissions: # added using https://github.com/step-security/secure-workflows contents: read checks: write + pull-requests: write jobs: unit-tests: From 7a4d1866868af5a8be772c1e27a82eec5748e1ef Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 22:49:49 +1100 Subject: [PATCH 10/55] Remove upload/download Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 41 ---------------------- .github/workflows/ci-unit-tests.yml | 16 --------- 2 files changed, 57 deletions(-) delete mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml deleted file mode 100644 index e7ac97b0b29..00000000000 --- a/.github/workflows/ci-unit-tests-report.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Unit Test Results - -on: - workflow_run: - workflows: ["Unit Tests"] - types: - - completed - -jobs: - unit-test-results: - name: Unit Test Results - runs-on: ubuntu-latest - - permissions: - checks: write - - # Needed unless run with comment_mode: off. - pull-requests: write - - # Required by download step to access artifacts API. - actions: read - - steps: - - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 - with: - egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - - name: Download and Extract Artifacts - uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - path: artifacts - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - commit: ${{ github.event.workflow_run.head_sha }} - event_file: artifacts/Event File/event.json - event_name: ${{ github.event.workflow_run.event }} - files: "artifacts/**/*.xml" diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 6f8eebbd1bd..92dc2bf2ada 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -43,13 +43,6 @@ jobs: check_name: Unit Tests Summary junit_files: junit-report.xml - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v3 - with: - name: Test Results - path: junit-report.xml - - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -62,12 +55,3 @@ jobs: fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} - event-file: - name: "Event File" - runs-on: ubuntu-latest - steps: - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: Event File - path: ${{ github.event_path }} From 7abd7541e59fbde162d66eb225445adbfc4b1a62 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 23:20:22 +1100 Subject: [PATCH 11/55] Revert "Remove upload/download" This reverts commit 7a4d1866868af5a8be772c1e27a82eec5748e1ef. --- .github/workflows/ci-unit-tests-report.yml | 41 ++++++++++++++++++++++ .github/workflows/ci-unit-tests.yml | 16 +++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml new file mode 100644 index 00000000000..e7ac97b0b29 --- /dev/null +++ b/.github/workflows/ci-unit-tests-report.yml @@ -0,0 +1,41 @@ +name: Unit Test Results + +on: + workflow_run: + workflows: ["Unit Tests"] + types: + - completed + +jobs: + unit-test-results: + name: Unit Test Results + runs-on: ubuntu-latest + + permissions: + checks: write + + # Needed unless run with comment_mode: off. + pull-requests: write + + # Required by download step to access artifacts API. + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Download and Extract Artifacts + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 92dc2bf2ada..6f8eebbd1bd 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -43,6 +43,13 @@ jobs: check_name: Unit Tests Summary junit_files: junit-report.xml + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: junit-report.xml + - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -55,3 +62,12 @@ jobs: fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} + event-file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} From 2ed1da109b0a2b5e08af029b25a2840420e1001c Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 23:22:39 +1100 Subject: [PATCH 12/55] Disable comment and checks in unit tests Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 6f8eebbd1bd..02ff1de9329 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -14,8 +14,6 @@ concurrency: # See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions permissions: # added using https://github.com/step-security/secure-workflows contents: read - checks: write - pull-requests: write jobs: unit-tests: @@ -42,6 +40,8 @@ jobs: with: check_name: Unit Tests Summary junit_files: junit-report.xml + comment_mode: off + check_run: false - name: Upload Test Results if: always() From d0ab66ad72e9c2e25f7387f837ef0c5e51502b59 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 23:32:12 +1100 Subject: [PATCH 13/55] Add unit test report workflow --- .github/workflows/ci-unit-tests-report.yml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml new file mode 100644 index 00000000000..e7ac97b0b29 --- /dev/null +++ b/.github/workflows/ci-unit-tests-report.yml @@ -0,0 +1,41 @@ +name: Unit Test Results + +on: + workflow_run: + workflows: ["Unit Tests"] + types: + - completed + +jobs: + unit-test-results: + name: Unit Test Results + runs-on: ubuntu-latest + + permissions: + checks: write + + # Needed unless run with comment_mode: off. + pull-requests: write + + # Required by download step to access artifacts API. + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Download and Extract Artifacts + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" From d19412da8b2aa30ffa9a4de30b33596b387bf30b Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 25 Dec 2023 23:46:10 +1100 Subject: [PATCH 14/55] Add comment Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 02ff1de9329..78e2a9fbaa4 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -40,6 +40,7 @@ jobs: with: check_name: Unit Tests Summary junit_files: junit-report.xml + # PR comments and check run will be performed by the "Unit Test Results" workflow. comment_mode: off check_run: false From b608318660f09b2d9ed50740009f2e40036bd1f5 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 08:34:20 +1100 Subject: [PATCH 15/55] Sync update-test-report Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 8ca5d998b46..78e2a9fbaa4 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main] + branches: [main, upload-test-report] pull_request: branches: [main] @@ -40,6 +40,16 @@ jobs: with: check_name: Unit Tests Summary junit_files: junit-report.xml + # PR comments and check run will be performed by the "Unit Test Results" workflow. + comment_mode: off + check_run: false + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: junit-report.xml - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -52,3 +62,13 @@ jobs: flags: unittests fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} + + event-file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} From 2e8114262d567e42d95d7b6b965d478497bc41f0 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 08:36:54 +1100 Subject: [PATCH 16/55] Trigger CI run Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index e7ac97b0b29..e20f51316a8 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -24,7 +24,7 @@ jobs: - name: Harden Runner uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: - egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs - name: Download and Extract Artifacts uses: actions/download-artifact@v4 From 2cee89546e5a2d0e9fcc67c1a027b54457b75b32 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 08:48:43 +1100 Subject: [PATCH 17/55] Use this branch Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 78e2a9fbaa4..ecf7dfc48ff 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main, upload-test-report] + branches: [main, upload-test-report-1] pull_request: branches: [main] From 4cd4210d94eb94323e06871e97957bebe21bbd35 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 09:30:25 +1100 Subject: [PATCH 18/55] List dir Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index e20f51316a8..5dc453882c8 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -31,6 +31,8 @@ jobs: with: run-id: ${{ github.event.workflow_run.id }} path: artifacts + - name: Display structure of downloaded files + run: ls -R artifacts - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 From d54cdb1064feddc379ba218be81b086be18aa3ee Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 09:44:11 +1100 Subject: [PATCH 19/55] Use default run-id Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 5dc453882c8..a1f8c956a8d 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -29,7 +29,7 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 with: - run-id: ${{ github.event.workflow_run.id }} +# run-id: ${{ github.event.workflow_run.id }} path: artifacts - name: Display structure of downloaded files run: ls -R artifacts From d6429200f5563332454230bf3b258f13b6228ada Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 10:12:37 +1100 Subject: [PATCH 20/55] Simplify Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index a1f8c956a8d..9f54d2e738d 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -28,11 +28,11 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 - with: +# with: # run-id: ${{ github.event.workflow_run.id }} - path: artifacts +# path: artifacts - name: Display structure of downloaded files - run: ls -R artifacts + run: ls -R - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 From 4d66ba7229204cdf9b38154f45376803a0105c10 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 10:35:53 +1100 Subject: [PATCH 21/55] Simplify Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index e7ac97b0b29..9f54d2e738d 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -24,13 +24,15 @@ jobs: - name: Harden Runner uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: - egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs - name: Download and Extract Artifacts uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - path: artifacts +# with: +# run-id: ${{ github.event.workflow_run.id }} +# path: artifacts + - name: Display structure of downloaded files + run: ls -R - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 From ab9cdcbdf5abf7b8be0f65c8aa9380f7990f1f1c Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 10:37:38 +1100 Subject: [PATCH 22/55] Trigger CI Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 9f54d2e738d..372f224dde2 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -29,6 +29,7 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 # with: +# # run-id: ${{ github.event.workflow_run.id }} # path: artifacts - name: Display structure of downloaded files From 178390d581b7e443ae5ac6309dfa878aca9f0e75 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 10:52:20 +1100 Subject: [PATCH 23/55] token --- .github/workflows/ci-unit-tests-report.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 9f54d2e738d..5521b2aef39 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -28,7 +28,10 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 -# with: + with: + github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo +# repository: actions/toolkit +# run-id: 1234 # run-id: ${{ github.event.workflow_run.id }} # path: artifacts - name: Display structure of downloaded files From 2b98179b04b3477b6e626fdff088592075b96977 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 10:52:35 +1100 Subject: [PATCH 24/55] Trigger CI Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 372f224dde2..9f54d2e738d 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -29,7 +29,6 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 # with: -# # run-id: ${{ github.event.workflow_run.id }} # path: artifacts - name: Display structure of downloaded files From bed78f6f958a44328acb79982ab91018d9602c8b Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 11:08:31 +1100 Subject: [PATCH 25/55] Specify runid Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 5521b2aef39..8f121ec01b8 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -30,6 +30,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo + run_id: ${{ github.event.workflow_run.id }} # repository: actions/toolkit # run-id: 1234 # run-id: ${{ github.event.workflow_run.id }} From fb93374dbbc4e3f581c33601973cd79cd584fb7f Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 11:09:05 +1100 Subject: [PATCH 26/55] Trigger CI Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 9f54d2e738d..372f224dde2 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -29,6 +29,7 @@ jobs: - name: Download and Extract Artifacts uses: actions/download-artifact@v4 # with: +# # run-id: ${{ github.event.workflow_run.id }} # path: artifacts - name: Display structure of downloaded files From 808c55af8c5b2ded25387e3549951b2647ed609a Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 11:19:42 +1100 Subject: [PATCH 27/55] run-id Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 8f121ec01b8..41fd958a853 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -30,7 +30,7 @@ jobs: uses: actions/download-artifact@v4 with: github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo - run_id: ${{ github.event.workflow_run.id }} + run-id: ${{ github.event.workflow_run.id }} # repository: actions/toolkit # run-id: 1234 # run-id: ${{ github.event.workflow_run.id }} From 0dcb951a8f18c7aaeeccf2b1d67d51ae8efab4ad Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 19:36:20 +1100 Subject: [PATCH 28/55] sync Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-report.yml | 47 ++++++++++++++++++++++ .github/workflows/ci-unit-tests.yml | 22 +++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-unit-tests-report.yml diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml new file mode 100644 index 00000000000..41fd958a853 --- /dev/null +++ b/.github/workflows/ci-unit-tests-report.yml @@ -0,0 +1,47 @@ +name: Unit Test Results + +on: + workflow_run: + workflows: ["Unit Tests"] + types: + - completed + +jobs: + unit-test-results: + name: Unit Test Results + runs-on: ubuntu-latest + + permissions: + checks: write + + # Needed unless run with comment_mode: off. + pull-requests: write + + # Required by download step to access artifacts API. + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs + + - name: Download and Extract Artifacts + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo + run-id: ${{ github.event.workflow_run.id }} +# repository: actions/toolkit +# run-id: 1234 +# run-id: ${{ github.event.workflow_run.id }} +# path: artifacts + - name: Display structure of downloaded files + run: ls -R + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml" diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 8ca5d998b46..ecf7dfc48ff 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main] + branches: [main, upload-test-report-1] pull_request: branches: [main] @@ -40,6 +40,16 @@ jobs: with: check_name: Unit Tests Summary junit_files: junit-report.xml + # PR comments and check run will be performed by the "Unit Test Results" workflow. + comment_mode: off + check_run: false + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: junit-report.xml - name: Setup CODECOV_TOKEN uses: ./.github/actions/setup-codecov @@ -52,3 +62,13 @@ jobs: flags: unittests fail_ci_if_error: true token: ${{ env.CODECOV_TOKEN }} + + event-file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} From 69e240880c662269b6328be1fca04b43502ca348 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 19:45:23 +1100 Subject: [PATCH 29/55] Update test report workflow --- .github/workflows/ci-unit-tests-report.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 41fd958a853..5e2108a4f9a 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -10,6 +10,7 @@ jobs: unit-test-results: name: Unit Test Results runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' permissions: checks: write @@ -27,14 +28,14 @@ jobs: egress-policy: audit # TODO: change to 'egress-policy: block' after a couple of runs - name: Download and Extract Artifacts - uses: actions/download-artifact@v4 + uses: dawidd6/action-download-artifact@v3 with: - github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo - run-id: ${{ github.event.workflow_run.id }} +# github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo + run_id: ${{ github.event.workflow_run.id }} # repository: actions/toolkit # run-id: 1234 # run-id: ${{ github.event.workflow_run.id }} -# path: artifacts + path: artifacts - name: Display structure of downloaded files run: ls -R From 737acd81deefc01d1f48391009aede280de09fe9 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 19:45:56 +1100 Subject: [PATCH 30/55] Run gotip Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index 01382e9a5b8..115ca8fa799 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -2,7 +2,7 @@ name: Unit Tests on Go Tip on: push: - branches: [main] + branches: [main, upload-test-report-1] # See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions permissions: # added using https://github.com/step-security/secure-workflows From 627ba9af38dbd3b9e95c9c8ded9f24db28580217 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 20:04:15 +1100 Subject: [PATCH 31/55] Debug Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index 115ca8fa799..eb3463f6e52 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -25,6 +25,9 @@ jobs: - name: Run unit tests run: make test-ci + - name: Display structure of GOROOT + run: "ls -R $HOME/sdk/gotip/bin" + - name: Publish Unit Test Summary 📑 uses: EnricoMi/publish-unit-test-result-action@v2 if: always() From a1549931ce4ae2b0f48d8c74801b8857df79ec37 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 20:26:08 +1100 Subject: [PATCH 32/55] Log path Signed-off-by: Albert Teoh --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 3858c2ce101..f8cbc029141 100644 --- a/Makefile +++ b/Makefile @@ -510,6 +510,9 @@ install-ci: install-test-tools install-build-tools .PHONY: test-ci test-ci: GOTEST := $(GOTEST_QUIET) -json test-ci: install-test-tools build-examples cover test-report +test-ci: + ls $(HOME)/sdk/gotip/bin && \ + ls $(GOROOT)/bin .PHONY: test-report test-report: From f5fd5ba5205cad389aa0b76157c2ab2fc43678d3 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 20:26:59 +1100 Subject: [PATCH 33/55] install test tools Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index eb3463f6e52..a11b03e851c 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -22,6 +22,9 @@ jobs: - name: Install Go Tip uses: ./.github/actions/setup-go-tip + - name: Run unit tests + run: make install-test-tools + - name: Run unit tests run: make test-ci From 8bdd2f453b714ed5a1b70b0dce0245b8bd33c459 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 20:43:26 +1100 Subject: [PATCH 34/55] which go Signed-off-by: Albert Teoh --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f8cbc029141..ea0df81f90c 100644 --- a/Makefile +++ b/Makefile @@ -511,8 +511,7 @@ install-ci: install-test-tools install-build-tools test-ci: GOTEST := $(GOTEST_QUIET) -json test-ci: install-test-tools build-examples cover test-report test-ci: - ls $(HOME)/sdk/gotip/bin && \ - ls $(GOROOT)/bin + which go .PHONY: test-report test-report: From 0fdd51f60fe9bf8f590235b16183a73f26d33817 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 21:13:09 +1100 Subject: [PATCH 35/55] Remove make install test tools Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index a11b03e851c..c22c544be83 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -22,21 +22,21 @@ jobs: - name: Install Go Tip uses: ./.github/actions/setup-go-tip - - name: Run unit tests - run: make install-test-tools +# - name: Run unit tests +# run: make install-test-tools - name: Run unit tests run: make test-ci - - name: Display structure of GOROOT - run: "ls -R $HOME/sdk/gotip/bin" - - name: Publish Unit Test Summary 📑 uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: - check_name: Unit Tests Summary + check_name: Go Tip Unit Tests Summary junit_files: junit-report.xml + # This workflow isn't run during Pull Requests, so check run and PR comment summaries are not needed. + check_run: false + comment_mode: off - name: Lint run: echo skip linting on Go tip From e7b7a03b98794f4b366fb8763fbaaf0b08152c25 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 21:23:47 +1100 Subject: [PATCH 36/55] echo go Signed-off-by: Albert Teoh --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ea0df81f90c..fc8826f2a78 100644 --- a/Makefile +++ b/Makefile @@ -511,7 +511,7 @@ install-ci: install-test-tools install-build-tools test-ci: GOTEST := $(GOTEST_QUIET) -json test-ci: install-test-tools build-examples cover test-report test-ci: - which go + echo "go path: " && which $(GO) .PHONY: test-report test-report: From b38347f3339dc23254f85db7686bd78406e0d6a3 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 21:36:28 +1100 Subject: [PATCH 37/55] echo path --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fc8826f2a78..66c90050c40 100644 --- a/Makefile +++ b/Makefile @@ -510,11 +510,11 @@ install-ci: install-test-tools install-build-tools .PHONY: test-ci test-ci: GOTEST := $(GOTEST_QUIET) -json test-ci: install-test-tools build-examples cover test-report -test-ci: - echo "go path: " && which $(GO) .PHONY: test-report test-report: + echo "go path: " && which $(GO) && \ + echo "path: $$PATH" && \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml .PHONY: thrift From 3f9a93726ba928ebdffd18755dd53dc8f65e96f9 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 21:48:33 +1100 Subject: [PATCH 38/55] echo contents goroot --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 66c90050c40..508dd601c9d 100644 --- a/Makefile +++ b/Makefile @@ -515,6 +515,7 @@ test-ci: install-test-tools build-examples cover test-report test-report: echo "go path: " && which $(GO) && \ echo "path: $$PATH" && \ + echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml .PHONY: thrift From 52a612ef3fa87a3b6d4e5dffe01a93819f9e562f Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 21:54:58 +1100 Subject: [PATCH 39/55] echo contents goroot --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 508dd601c9d..7732fc8ede6 100644 --- a/Makefile +++ b/Makefile @@ -515,7 +515,7 @@ test-ci: install-test-tools build-examples cover test-report test-report: echo "go path: " && which $(GO) && \ echo "path: $$PATH" && \ - echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ \ + echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ && \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml .PHONY: thrift From b9452aa44fc7f58b53e2f0b8864a5e48be65db17 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 22:03:41 +1100 Subject: [PATCH 40/55] echo contents goroot --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7732fc8ede6..65594b802cf 100644 --- a/Makefile +++ b/Makefile @@ -516,6 +516,7 @@ test-report: echo "go path: " && which $(GO) && \ echo "path: $$PATH" && \ echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ && \ + echo "contents of original goroot: " && ls -al /home/runner/go/bin/ && \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml .PHONY: thrift From 07034c23ad3419e076564447dc8ae6061f79d987 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Tue, 26 Dec 2023 22:14:43 +1100 Subject: [PATCH 41/55] echo which go --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 65594b802cf..e7e4fe29f43 100644 --- a/Makefile +++ b/Makefile @@ -495,6 +495,8 @@ install-test-tools: $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 $(GO) install mvdan.cc/gofumpt@latest $(GO) install github.com/jstemmer/go-junit-report/v2@latest +install-test-tools: + echo "install-test-tools: which go: " && which $(GO) .PHONY: install-build-tools install-build-tools: From d9dc36d63371d29564620b99069598f3b7e2701a Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 07:11:21 +1100 Subject: [PATCH 42/55] Revert --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index e7e4fe29f43..65594b802cf 100644 --- a/Makefile +++ b/Makefile @@ -495,8 +495,6 @@ install-test-tools: $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 $(GO) install mvdan.cc/gofumpt@latest $(GO) install github.com/jstemmer/go-junit-report/v2@latest -install-test-tools: - echo "install-test-tools: which go: " && which $(GO) .PHONY: install-build-tools install-build-tools: From 24a6260c0879bcc86e35d159fa721402fe3b1e65 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 07:20:23 +1100 Subject: [PATCH 43/55] Echo gopath --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 65594b802cf..5d2c7975da2 100644 --- a/Makefile +++ b/Makefile @@ -515,6 +515,7 @@ test-ci: install-test-tools build-examples cover test-report test-report: echo "go path: " && which $(GO) && \ echo "path: $$PATH" && \ + echo "gopath: $$GOPATH" && \ echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ && \ echo "contents of original goroot: " && ls -al /home/runner/go/bin/ && \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml From 07809e219d78cc0bdd779bff62f6f4f28cacbc4b Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 07:30:47 +1100 Subject: [PATCH 44/55] Export gopath --- .github/actions/setup-go-tip/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-go-tip/action.yml b/.github/actions/setup-go-tip/action.yml index 750a9d796f7..c7e7db9d172 100644 --- a/.github/actions/setup-go-tip/action.yml +++ b/.github/actions/setup-go-tip/action.yml @@ -30,10 +30,12 @@ runs: echo "Downloaded bundle:" ls -lah gotip.tar.gz export GOROOT="$HOME/sdk/gotip" + export GOPATH="$HOME/go" mkdir -p $GOROOT tar -C $GOROOT -xzf gotip.tar.gz - export PATH="$GOROOT/bin/:$PATH" + export PATH="$GOROOT/bin/:$GOPATH/bin:$PATH" echo "GOROOT=$GOROOT" >> $GITHUB_ENV + echo "GOPATH=$GOPATH" >> $GITHUB_ENV echo "PATH=$PATH" >> $GITHUB_ENV echo "Active Go version:" go version \ No newline at end of file From 23a02231223f6665e645e6cb8d095ba5de6f075f Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 09:00:47 +1100 Subject: [PATCH 45/55] Reinstate make install-test-tools --- .github/actions/setup-go-tip/action.yml | 4 +--- .github/workflows/ci-unit-tests-go-tip.yml | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-go-tip/action.yml b/.github/actions/setup-go-tip/action.yml index c7e7db9d172..750a9d796f7 100644 --- a/.github/actions/setup-go-tip/action.yml +++ b/.github/actions/setup-go-tip/action.yml @@ -30,12 +30,10 @@ runs: echo "Downloaded bundle:" ls -lah gotip.tar.gz export GOROOT="$HOME/sdk/gotip" - export GOPATH="$HOME/go" mkdir -p $GOROOT tar -C $GOROOT -xzf gotip.tar.gz - export PATH="$GOROOT/bin/:$GOPATH/bin:$PATH" + export PATH="$GOROOT/bin/:$PATH" echo "GOROOT=$GOROOT" >> $GITHUB_ENV - echo "GOPATH=$GOPATH" >> $GITHUB_ENV echo "PATH=$PATH" >> $GITHUB_ENV echo "Active Go version:" go version \ No newline at end of file diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index c22c544be83..04b7f5527bc 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -22,8 +22,8 @@ jobs: - name: Install Go Tip uses: ./.github/actions/setup-go-tip -# - name: Run unit tests -# run: make install-test-tools + - name: Run unit tests + run: make install-test-tools - name: Run unit tests run: make test-ci From 4df70d1ea2ae86e990e317abf998cafbff498d06 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 09:28:24 +1100 Subject: [PATCH 46/55] Remove install-test-tools Signed-off-by: Albert Teoh --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5d2c7975da2..672230459b9 100644 --- a/Makefile +++ b/Makefile @@ -509,7 +509,7 @@ install-ci: install-test-tools install-build-tools .PHONY: test-ci test-ci: GOTEST := $(GOTEST_QUIET) -json -test-ci: install-test-tools build-examples cover test-report +test-ci: build-examples cover test-report .PHONY: test-report test-report: From 5971d1e737b8e0d94b09b24160343b2d91b8eaae Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Wed, 27 Dec 2023 21:28:21 +1100 Subject: [PATCH 47/55] WIP Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index 04b7f5527bc..de4dbf97813 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -22,7 +22,7 @@ jobs: - name: Install Go Tip uses: ./.github/actions/setup-go-tip - - name: Run unit tests + - name: Install test tools run: make install-test-tools - name: Run unit tests From ffb5a580321650f1b111d279db2d3d7900e3c3e4 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Sat, 30 Dec 2023 09:32:46 +1100 Subject: [PATCH 48/55] Fail test Signed-off-by: Albert Teoh --- empty_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/empty_test.go b/empty_test.go index 9cdf96af026..081dce6edb0 100644 --- a/empty_test.go +++ b/empty_test.go @@ -15,6 +15,7 @@ package jaeger import ( + "github.com/stretchr/testify/assert" "testing" "go.uber.org/goleak" @@ -23,6 +24,7 @@ import ( func TestDummy(t *testing.T) { // This is a dummy test in the root package. // Without it `go test -v .` prints "testing: warning: no tests to run". + assert.FailNow(t, "failing to test out summary output") } func TestMain(m *testing.M) { From ff9d982cc05763c45137a4afb2942bc0a2aed2b0 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Sat, 30 Dec 2023 11:34:27 +1100 Subject: [PATCH 49/55] pipefail Signed-off-by: Albert Teoh --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 672230459b9..5895cd19748 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ index-rollover-integration-test: docker-images-elastic .PHONY: cover cover: nocover - $(GOTEST) -tags=memory_storage_integration -timeout 5m -coverprofile cover.out ./... > test-results.json + bash -c "set -e; set -o pipefail; $(GOTEST) -tags=memory_storage_integration -timeout 5m -coverprofile cover.out ./... | tee test-results.json" go tool cover -html=cover.out -o cover.html .PHONY: nocover From 2aac566d350880dc8f93c1f9345fb113fa1e7f95 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Sat, 30 Dec 2023 11:39:38 +1100 Subject: [PATCH 50/55] Separate test report from ci Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests.yml | 8 ++++++++ Makefile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index ecf7dfc48ff..f9372e07091 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -31,9 +31,17 @@ jobs: go-version: 1.21.x cache-dependency-path: ./go.sum + - name: Install test deps + # even though the same target runs from test-ci, running it separately makes for cleaner log in GH workflow + run: make install-test-tools + - name: Run unit tests run: make test-ci + - name: Prepare unit tests report + if: always() + run: make test-report + - name: Publish Unit Test Summary 📑 uses: EnricoMi/publish-unit-test-result-action@v2 if: always() diff --git a/Makefile b/Makefile index 5895cd19748..1cfbb1b74f3 100644 --- a/Makefile +++ b/Makefile @@ -509,7 +509,7 @@ install-ci: install-test-tools install-build-tools .PHONY: test-ci test-ci: GOTEST := $(GOTEST_QUIET) -json -test-ci: build-examples cover test-report +test-ci: build-examples cover .PHONY: test-report test-report: From 7a8e42d369d597ab51d249a06b1688bfa95fafc4 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Sat, 30 Dec 2023 11:53:03 +1100 Subject: [PATCH 51/55] Fix test report failure Signed-off-by: Albert Teoh --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 1cfbb1b74f3..5e0187b5f18 100644 --- a/Makefile +++ b/Makefile @@ -513,11 +513,6 @@ test-ci: build-examples cover .PHONY: test-report test-report: - echo "go path: " && which $(GO) && \ - echo "path: $$PATH" && \ - echo "gopath: $$GOPATH" && \ - echo "contents of goroot: " && ls -al /home/runner/sdk/gotip/bin/ && \ - echo "contents of original goroot: " && ls -al /home/runner/go/bin/ && \ cat test-results.json | go-junit-report -parser gojson > junit-report.xml .PHONY: thrift From b831ba6b5b09332fa02b86709f1305cdffaf5ef5 Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 1 Jan 2024 18:08:04 +1100 Subject: [PATCH 52/55] Preven new test names from being created Signed-off-by: Albert Teoh --- cmd/query/app/handler_archive_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/query/app/handler_archive_test.go b/cmd/query/app/handler_archive_test.go index 6db45a2ef89..763b75ceab8 100644 --- a/cmd/query/app/handler_archive_test.go +++ b/cmd/query/app/handler_archive_test.go @@ -34,7 +34,19 @@ func TestGetArchivedTrace_NotFound(t *testing.T) { mockReader := &spanstoremocks.Reader{} mockReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() - for _, tc := range []spanstore.Reader{nil, mockReader} { + for _, tc := range []struct { + name string + reader spanstore.Reader + }{ + { + name: "nil", + reader: nil, + }, + { + name: "mock reader", + reader: mockReader, + }, + } { archiveReader := tc // capture loop var t.Run(fmt.Sprint(archiveReader), func(t *testing.T) { withTestServer(func(ts *testServer) { From 40331a805fcf12dd98542a80b41f2ce9509f0b0f Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 1 Jan 2024 18:14:30 +1100 Subject: [PATCH 53/55] Cleanup Signed-off-by: Albert Teoh --- .github/workflows/ci-unit-tests-go-tip.yml | 2 +- .github/workflows/ci-unit-tests-report.yml | 6 ------ .github/workflows/ci-unit-tests.yml | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-unit-tests-go-tip.yml b/.github/workflows/ci-unit-tests-go-tip.yml index 82d341b064f..4e0e2ece919 100644 --- a/.github/workflows/ci-unit-tests-go-tip.yml +++ b/.github/workflows/ci-unit-tests-go-tip.yml @@ -2,7 +2,7 @@ name: Unit Tests on Go Tip on: push: - branches: [main, upload-test-report-1] + branches: [main] # See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions permissions: # added using https://github.com/step-security/secure-workflows diff --git a/.github/workflows/ci-unit-tests-report.yml b/.github/workflows/ci-unit-tests-report.yml index 5e2108a4f9a..a25f62262b0 100644 --- a/.github/workflows/ci-unit-tests-report.yml +++ b/.github/workflows/ci-unit-tests-report.yml @@ -30,14 +30,8 @@ jobs: - name: Download and Extract Artifacts uses: dawidd6/action-download-artifact@v3 with: -# github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo run_id: ${{ github.event.workflow_run.id }} -# repository: actions/toolkit -# run-id: 1234 -# run-id: ${{ github.event.workflow_run.id }} path: artifacts - - name: Display structure of downloaded files - run: ls -R - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml index 6dbfdfef162..2cdd0b7f2ee 100644 --- a/.github/workflows/ci-unit-tests.yml +++ b/.github/workflows/ci-unit-tests.yml @@ -2,7 +2,7 @@ name: Unit Tests on: push: - branches: [main, upload-test-report-1] + branches: [main] pull_request: branches: [main] From 7a575e35105c94f20e109f631253f664b830154c Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 1 Jan 2024 18:15:45 +1100 Subject: [PATCH 54/55] Update IDL Signed-off-by: Albert Teoh --- idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idl b/idl index de44a4e9373..cd5d410a252 160000 --- a/idl +++ b/idl @@ -1 +1 @@ -Subproject commit de44a4e93731f57a6a926e16dffa1767de7a0f22 +Subproject commit cd5d410a252cc7e4683ad2aa0e7ffe2263539e37 From 36a32c913713a51d2818d0afc8fb52f9730d914b Mon Sep 17 00:00:00 2001 From: Albert Teoh Date: Mon, 1 Jan 2024 18:21:24 +1100 Subject: [PATCH 55/55] Fix lint Signed-off-by: Albert Teoh --- cmd/query/app/handler_archive_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/query/app/handler_archive_test.go b/cmd/query/app/handler_archive_test.go index 763b75ceab8..9b48941d0cb 100644 --- a/cmd/query/app/handler_archive_test.go +++ b/cmd/query/app/handler_archive_test.go @@ -17,7 +17,6 @@ package app import ( "errors" - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -47,8 +46,8 @@ func TestGetArchivedTrace_NotFound(t *testing.T) { reader: mockReader, }, } { - archiveReader := tc // capture loop var - t.Run(fmt.Sprint(archiveReader), func(t *testing.T) { + tc := tc // capture loop var + t.Run(tc.name, func(t *testing.T) { withTestServer(func(ts *testServer) { ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), mock.AnythingOfType("model.TraceID")). Return(nil, spanstore.ErrTraceNotFound).Once() @@ -57,7 +56,7 @@ func TestGetArchivedTrace_NotFound(t *testing.T) { require.EqualError(t, err, `404 error from server: {"data":null,"total":0,"limit":0,"offset":0,"errors":[{"code":404,"msg":"trace not found"}]}`+"\n", ) - }, querysvc.QueryServiceOptions{ArchiveSpanReader: archiveReader}) // nil is ok + }, querysvc.QueryServiceOptions{ArchiveSpanReader: tc.reader}) // nil is ok }) } }