From 6d610b67e0d660a91ae01dc47337e2f0d098fd7a Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 16 Dec 2024 14:41:26 -0500 Subject: [PATCH 1/4] try adding to node.js file --- .github/workflows/node.js.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a7541f39b9c..cab15152931 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -189,6 +189,17 @@ jobs: verbose: true file: ./coverage/amazonq/lcov.info token: ${{ secrets.CODECOV_TOKEN }} + - name: 'Test Analytics (Toolkit)' + env: + # Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475 + NODE_OPTIONS: '' + if: ${{ !cancelled() && github.repository == 'aws/aws-toolkit-vscode' && github.event_name == 'pull_request' && github.base_ref == 'master' }} + uses: codecov/test-results-action@v1 + with: + flags: macos-analytics-toolkit-unittests + verbose: true + file: ./coverage/toolkit/test-results.json + token: ${{ secrets.CODECOV_TOKEN }} web: needs: lint-commits From c4ca6e756e95be62bb19214f29c2e1a7dbd9372c Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 16 Dec 2024 14:50:53 -0500 Subject: [PATCH 2/4] change file target --- .github/workflows/node.js.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cab15152931..e34c65c0ab6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -198,7 +198,18 @@ jobs: with: flags: macos-analytics-toolkit-unittests verbose: true - file: ./coverage/toolkit/test-results.json + file: .test-reports/amazonwebservices.aws-toolkit-vscode-report.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: 'Test Analytics (Amazon Q)' + env: + # Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475 + NODE_OPTIONS: '' + if: ${{ !cancelled() && github.repository == 'aws/aws-toolkit-vscode' && github.event_name == 'pull_request' && github.base_ref == 'master' }} + uses: codecov/test-results-action@v1 + with: + flags: macos-analytics-amazonq-unittests + verbose: true + file: .test-reports/amazonwebservices.amazon-q-vscode-report.xml token: ${{ secrets.CODECOV_TOKEN }} web: From 52a8c5068a2d7c23a281f2a6aed9e2f6eeff2ec0 Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 16 Dec 2024 14:59:30 -0500 Subject: [PATCH 3/4] make path properly relative --- .github/workflows/node.js.yml | 4 ++-- packages/core/src/test/testRunner.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e34c65c0ab6..501baff03b0 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -198,7 +198,7 @@ jobs: with: flags: macos-analytics-toolkit-unittests verbose: true - file: .test-reports/amazonwebservices.aws-toolkit-vscode-report.xml + file: ./test-reports/amazonwebservices.aws-toolkit-vscode-report.xml token: ${{ secrets.CODECOV_TOKEN }} - name: 'Test Analytics (Amazon Q)' env: @@ -209,7 +209,7 @@ jobs: with: flags: macos-analytics-amazonq-unittests verbose: true - file: .test-reports/amazonwebservices.amazon-q-vscode-report.xml + file: ./test-reports/amazonwebservices.amazon-q-vscode-report.xml token: ${{ secrets.CODECOV_TOKEN }} web: diff --git a/packages/core/src/test/testRunner.ts b/packages/core/src/test/testRunner.ts index 7a90977587c..ded911edf5c 100644 --- a/packages/core/src/test/testRunner.ts +++ b/packages/core/src/test/testRunner.ts @@ -65,9 +65,9 @@ export async function runTests( } const root = getRoot() - const outputFile = path.resolve(root, '../../', '.test-reports', 'report.xml') + const outputFile = path.resolve(root, '../../', '.test-reports', `${extensionId}-report.xml`) const colorOutput = !process.env['AWS_TOOLKIT_TEST_NO_COLOR'] - + console.log('Test being output to %s', outputFile) // Create the mocha test const mocha = new Mocha({ ui: 'bdd', From e5abfad9a1f425e3e6280761d91820965105757b Mon Sep 17 00:00:00 2001 From: hkobew Date: Mon, 16 Dec 2024 15:11:12 -0500 Subject: [PATCH 4/4] include dot as prefix --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 501baff03b0..04cf36e78bb 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -198,7 +198,7 @@ jobs: with: flags: macos-analytics-toolkit-unittests verbose: true - file: ./test-reports/amazonwebservices.aws-toolkit-vscode-report.xml + file: ./.test-reports/amazonwebservices.aws-toolkit-vscode-report.xml token: ${{ secrets.CODECOV_TOKEN }} - name: 'Test Analytics (Amazon Q)' env: @@ -209,7 +209,7 @@ jobs: with: flags: macos-analytics-amazonq-unittests verbose: true - file: ./test-reports/amazonwebservices.amazon-q-vscode-report.xml + file: ./.test-reports/amazonwebservices.amazon-q-vscode-report.xml token: ${{ secrets.CODECOV_TOKEN }} web: