From 0b2aed904f5e9a5278d8d6f46a14942fdb3d5b2d Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 08:44:32 -0500 Subject: [PATCH 01/14] test(core): merge all package test reports Problem: - CI test reporting only captures the last package's results - Running `npm run testE2E` only preserves toolkit's report.xml, losing other package results Solution: - Generate individual report.xml files per subproject - Consolidate all existing package reports into root .test-reports/report.xml --- package.json | 11 +++--- packages/core/src/test/testRunner.ts | 3 +- scripts/mergeReports.ts | 55 ++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 scripts/mergeReports.ts diff --git a/package.json b/package.json index e658a3a916e..3c2fee33ba2 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present", - "testWeb": "npm run testWeb -w packages/ --if-present", - "testE2E": "npm run testE2E -w packages/ --if-present", - "testInteg": "npm run testInteg -w packages/ --if-present", + "test": "npm run test -w packages/ --if-present && npm run mergeReports", + "testWeb": "npm run testWeb -w packages/ --if-present && npm run mergeReports", + "testE2E": "npm run testE2E -w packages/ --if-present && npm run mergeReports", + "testInteg": "npm run testInteg -w packages/ --if-present && npm run mergeReports", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", @@ -36,7 +36,8 @@ "lintfix": "eslint -c .eslintrc.js --ignore-path .gitignore --ignore-pattern '**/*.json' --ignore-pattern '**/*.gen.ts' --ignore-pattern '**/types/*.d.ts' --ignore-pattern '**/src/testFixtures/**' --ignore-pattern '**/resources/js/graphStateMachine.js' --fix --ext .ts packages plugins", "clean": "npm run clean -w packages/ -w plugins/", "reset": "npm run clean && ts-node ./scripts/clean.ts node_modules && npm install", - "generateNonCodeFiles": "npm run generateNonCodeFiles -w packages/ --if-present" + "generateNonCodeFiles": "npm run generateNonCodeFiles -w packages/ --if-present", + "mergeReports": "ts-node ./scripts/mergeReports.ts" }, "devDependencies": { "@aws-toolkits/telemetry": "^1.0.289", diff --git a/packages/core/src/test/testRunner.ts b/packages/core/src/test/testRunner.ts index 7a90977587c..0b7b54dc9be 100644 --- a/packages/core/src/test/testRunner.ts +++ b/packages/core/src/test/testRunner.ts @@ -65,7 +65,8 @@ export async function runTests( } const root = getRoot() - const outputFile = path.resolve(root, '../../', '.test-reports', 'report.xml') + // output the report to the individual package + const outputFile = path.resolve(root, '.test-reports', 'report.xml') const colorOutput = !process.env['AWS_TOOLKIT_TEST_NO_COLOR'] // Create the mocha test diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts new file mode 100644 index 00000000000..fbf4107e339 --- /dev/null +++ b/scripts/mergeReports.ts @@ -0,0 +1,55 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import * as fs from 'fs' +import * as path from 'path' +import * as xml2js from 'xml2js' + +/** + * Merge all of the packages/ test reports and test logs into a single directory + */ +async function mergeReports() { + const packagesDir = path.join(__dirname, '..', 'packages') + + // Get all packages/* directories + const packageDirs = fs.readdirSync(packagesDir).map((dir) => path.join(packagesDir, dir)) + + // Find report.xml files in .test-reports subdirectories + const testReports = packageDirs + .map((dir) => path.join(dir, '.test-reports', 'report.xml')) + .filter((file) => fs.existsSync(file)) + + let mergedReport = { + testsuites: { + testsuite: [], + }, + } + + // Collect all test reports into a single merged test report object + for (const file of testReports) { + const content = fs.readFileSync(file) + const result: { testsuites: { testsuite: [] } } = await xml2js.parseStringPromise(content) + if (result.testsuites && result.testsuites.testsuite) { + mergedReport.testsuites.testsuite.push(...result.testsuites.testsuite) + } + } + + const builder = new xml2js.Builder() + const xml = builder.buildObject(mergedReport) + + /** + * Create the new test reports directory and write the test report + */ + const reportsDir = path.join(__dirname, '..', '.test-reports') + + // Create reports directory if it doesn't exist + if (!fs.existsSync(reportsDir)) { + fs.mkdirSync(reportsDir, { recursive: true }) + } + + fs.writeFileSync(path.join(reportsDir, 'report.xml'), xml) +} + +mergeReports() From 081c031aee5e3f3a42fb4ce745ca19e2c4a66a30 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 08:53:35 -0500 Subject: [PATCH 02/14] fixup --- scripts/mergeReports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index fbf4107e339..d9409cab762 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -8,7 +8,7 @@ import * as path from 'path' import * as xml2js from 'xml2js' /** - * Merge all of the packages/ test reports and test logs into a single directory + * Merge all of the packages/ test reports into a single directory */ async function mergeReports() { const packagesDir = path.join(__dirname, '..', 'packages') From 5ef73cf2765b616d8ff11a41c297e085ed90bdf6 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 08:54:29 -0500 Subject: [PATCH 03/14] test failures --- .../amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts | 1 + packages/core/src/test/typescriptLambdaHandlerSearch.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts index d89e97af7f0..e42b658d25b 100644 --- a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts +++ b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts @@ -8,6 +8,7 @@ import { parseVersionsListFromPomFile } from 'aws-core-vscode/codewhisperer/node describe('Amazon Q Transform - transformFileHandler tests', function () { describe('parseXmlDependenciesReport', function () { it('Will return parsed values', async function () { + assert.fail('testing') const testXmlReport = ` = new Set([ From dfe28923ceacd9cb7fccda8498f6d9cb315e1230 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 09:09:40 -0500 Subject: [PATCH 04/14] failure --- .../test/unit/amazonqGumby/transformFileHandler.test.ts | 4 +++- packages/core/src/test/typescriptLambdaHandlerSearch.test.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts index e42b658d25b..0085a77efce 100644 --- a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts +++ b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts @@ -6,9 +6,11 @@ import assert from 'assert' import { parseVersionsListFromPomFile } from 'aws-core-vscode/codewhisperer/node' describe('Amazon Q Transform - transformFileHandler tests', function () { + it('test failure', function () { + assert.fail('testing') + }) describe('parseXmlDependenciesReport', function () { it('Will return parsed values', async function () { - assert.fail('testing') const testXmlReport = ` = new Set([ From 5273b20bfc2d3d06fc5f150885556a528d117e62 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 10:05:00 -0500 Subject: [PATCH 05/14] test --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3c2fee33ba2..f73128bd4c0 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present && npm run mergeReports", - "testWeb": "npm run testWeb -w packages/ --if-present && npm run mergeReports", - "testE2E": "npm run testE2E -w packages/ --if-present && npm run mergeReports", - "testInteg": "npm run testInteg -w packages/ --if-present && npm run mergeReports", + "test": "npm run test -w packages/ --if-present; npm run mergeReports", + "testWeb": "npm run testWeb -w packages/ --if-present; npm run mergeReports", + "testE2E": "npm run testE2E -w packages/ --if-present; npm run mergeReports", + "testInteg": "npm run testInteg -w packages/ --if-present; npm run mergeReports", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", From 5b6e145b37345ef37887470c23c3399e88382d42 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 10:25:02 -0500 Subject: [PATCH 06/14] test --- package.json | 8 ++++---- scripts/mergeReports.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f73128bd4c0..d4ab97fa247 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present; npm run mergeReports", - "testWeb": "npm run testWeb -w packages/ --if-present; npm run mergeReports", - "testE2E": "npm run testE2E -w packages/ --if-present; npm run mergeReports", - "testInteg": "npm run testInteg -w packages/ --if-present; npm run mergeReports", + "test": "npm run test -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testWeb": "npm run testWeb -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testE2E": "npm run testE2E -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testInteg": "npm run testInteg -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index d9409cab762..00b5886c047 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -53,3 +53,11 @@ async function mergeReports() { } mergeReports() + +/** + * Grab the previous test runs exit code. This makes it so that merge and upload + * the reports regardless of the test run exit code and then use the previous test + * exit code to properly inform ci of the test run status + */ +const exitCode = parseInt(process.env.PREVIOUS_TEST_EXIT_CODE || '0', 10) +process.exit(exitCode) From adf5ca69f79163e2acdd13c3f54b0c49019953f5 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 10:44:35 -0500 Subject: [PATCH 07/14] test --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d4ab97fa247..cb669449f9d 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testWeb": "npm run testWeb -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testE2E": "npm run testE2E -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testInteg": "npm run testInteg -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "test": "npm run test -w packages/ --if-present", + "testWeb": "npm run testWeb -w packages/ --if-present", + "testE2E": "npm run testE2E -w packages/ --if-present", + "testInteg": "npm run testInteg -w packages/ --if-present", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", From 4e5655f63af77ad1ff93d32bd72ae768b64ca94e Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 10:55:05 -0500 Subject: [PATCH 08/14] test --- package.json | 8 ++++---- scripts/mergeReports.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cb669449f9d..d4ab97fa247 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present", - "testWeb": "npm run testWeb -w packages/ --if-present", - "testE2E": "npm run testE2E -w packages/ --if-present", - "testInteg": "npm run testInteg -w packages/ --if-present", + "test": "npm run test -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testWeb": "npm run testWeb -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testE2E": "npm run testE2E -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "testInteg": "npm run testInteg -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index 00b5886c047..40af37988b1 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -11,6 +11,8 @@ import * as xml2js from 'xml2js' * Merge all of the packages/ test reports into a single directory */ async function mergeReports() { + console.log('Merging test reports') + const packagesDir = path.join(__dirname, '..', 'packages') // Get all packages/* directories From bb0bf300922eb8ec62041fa6d15cec4ca94f840b Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 10:55:38 -0500 Subject: [PATCH 09/14] fixup --- scripts/mergeReports.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index 40af37988b1..9a0697d345e 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -52,14 +52,14 @@ async function mergeReports() { } fs.writeFileSync(path.join(reportsDir, 'report.xml'), xml) + + /** + * Grab the previous test runs exit code. This makes it so that merge and upload + * the reports regardless of the test run exit code and then use the previous test + * exit code to properly inform ci of the test run status + */ + const exitCode = parseInt(process.env.PREVIOUS_TEST_EXIT_CODE || '0', 10) + process.exit(exitCode) } mergeReports() - -/** - * Grab the previous test runs exit code. This makes it so that merge and upload - * the reports regardless of the test run exit code and then use the previous test - * exit code to properly inform ci of the test run status - */ -const exitCode = parseInt(process.env.PREVIOUS_TEST_EXIT_CODE || '0', 10) -process.exit(exitCode) From b7e94e07e3bf6baafeabab75b1372c97ec1664e4 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 11:26:42 -0500 Subject: [PATCH 10/14] fixup --- .../test/unit/amazonqGumby/transformFileHandler.test.ts | 3 --- packages/core/src/test/typescriptLambdaHandlerSearch.test.ts | 4 ---- scripts/mergeReports.ts | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts index 0085a77efce..d89e97af7f0 100644 --- a/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts +++ b/packages/amazonq/test/unit/amazonqGumby/transformFileHandler.test.ts @@ -6,9 +6,6 @@ import assert from 'assert' import { parseVersionsListFromPomFile } from 'aws-core-vscode/codewhisperer/node' describe('Amazon Q Transform - transformFileHandler tests', function () { - it('test failure', function () { - assert.fail('testing') - }) describe('parseXmlDependenciesReport', function () { it('Will return parsed values', async function () { const testXmlReport = ` diff --git a/packages/core/src/test/typescriptLambdaHandlerSearch.test.ts b/packages/core/src/test/typescriptLambdaHandlerSearch.test.ts index 561d6cedb62..4b9d347fd07 100644 --- a/packages/core/src/test/typescriptLambdaHandlerSearch.test.ts +++ b/packages/core/src/test/typescriptLambdaHandlerSearch.test.ts @@ -10,10 +10,6 @@ import { RootlessLambdaHandlerCandidate } from '../shared/lambdaHandlerSearch' import { TypescriptLambdaHandlerSearch } from '../shared/typescriptLambdaHandlerSearch' describe('TypescriptLambdaHandlerSearch', function () { - it('test failure', function () { - assert.fail('testing') - }) - it('finds export declared functions in Typescript code', async function () { const filename: string = path.join(testFixturesDir(), 'typescript/sampleFunctions.ts') diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index 9a0697d345e..05bc07f5a20 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -23,7 +23,7 @@ async function mergeReports() { .map((dir) => path.join(dir, '.test-reports', 'report.xml')) .filter((file) => fs.existsSync(file)) - let mergedReport = { + const mergedReport = { testsuites: { testsuite: [], }, From 9d89d5b9d0bb7621eb1b5a37e39f0495b9462166 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 11:31:59 -0500 Subject: [PATCH 11/14] fixup --- scripts/mergeReports.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/mergeReports.ts b/scripts/mergeReports.ts index 05bc07f5a20..f2159290a1c 100644 --- a/scripts/mergeReports.ts +++ b/scripts/mergeReports.ts @@ -54,9 +54,12 @@ async function mergeReports() { fs.writeFileSync(path.join(reportsDir, 'report.xml'), xml) /** - * Grab the previous test runs exit code. This makes it so that merge and upload - * the reports regardless of the test run exit code and then use the previous test - * exit code to properly inform ci of the test run status + * Retrieves the exit code from the previous test run execution. + * + * This allows us to: + * 1. Merge and upload test reports regardless of the test execution status + * 2. Preserve the original test run exit code + * 3. Report the test status back to CI */ const exitCode = parseInt(process.env.PREVIOUS_TEST_EXIT_CODE || '0', 10) process.exit(exitCode) From 155f4c58f8f4faa588f56ead459390df730e12a3 Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 12:49:50 -0500 Subject: [PATCH 12/14] fixup --- buildspec/linuxE2ETests.yml | 1 + buildspec/linuxIntegrationTests.yml | 1 + buildspec/linuxTests.yml | 2 +- package.json | 8 ++++---- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/buildspec/linuxE2ETests.yml b/buildspec/linuxE2ETests.yml index af3cfe71bde..72c428fe933 100644 --- a/buildspec/linuxE2ETests.yml +++ b/buildspec/linuxE2ETests.yml @@ -38,6 +38,7 @@ phases: - export HOME=/home/codebuild-user # Ignore failure until throttling issues are fixed. - xvfb-run npm run testE2E + - PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" diff --git a/buildspec/linuxIntegrationTests.yml b/buildspec/linuxIntegrationTests.yml index a40606bf8b3..a6ec2646442 100644 --- a/buildspec/linuxIntegrationTests.yml +++ b/buildspec/linuxIntegrationTests.yml @@ -93,6 +93,7 @@ phases: commands: - export HOME=/home/codebuild-user - xvfb-run npm run testInteg + - PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" diff --git a/buildspec/linuxTests.yml b/buildspec/linuxTests.yml index d8fff088c2f..70fd31274ca 100644 --- a/buildspec/linuxTests.yml +++ b/buildspec/linuxTests.yml @@ -41,7 +41,7 @@ phases: # Ensure that "foo | run_and_report" fails correctly. set -o pipefail . buildspec/shared/common.sh - 2>&1 xvfb-run npm test --silent | run_and_report 2 \ + 2>&1 xvfb-run npm test --silent; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports | run_and_report 2 \ 'rejected promise not handled' \ 'This typically indicates a bug. Read https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#error_handling' } diff --git a/package.json b/package.json index d4ab97fa247..cb669449f9d 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits", "compile": "npm run compile -w packages/", "testCompile": "npm run testCompile -w packages/ --if-present", - "test": "npm run test -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testWeb": "npm run testWeb -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testE2E": "npm run testE2E -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", - "testInteg": "npm run testInteg -w packages/ --if-present; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports", + "test": "npm run test -w packages/ --if-present", + "testWeb": "npm run testWeb -w packages/ --if-present", + "testE2E": "npm run testE2E -w packages/ --if-present", + "testInteg": "npm run testInteg -w packages/ --if-present", "package": "npm run package -w packages/toolkit -w packages/amazonq", "newChange": "echo 'Must specify subproject/workspace with -w packages/' && false", "createRelease": "echo 'Must specify subproject/workspace with -w packages/' && false", From d03a757310b95e4256fcc1ee06770f273f37779f Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 12:53:16 -0500 Subject: [PATCH 13/14] fixup --- buildspec/linuxE2ETests.yml | 3 +-- buildspec/linuxIntegrationTests.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/buildspec/linuxE2ETests.yml b/buildspec/linuxE2ETests.yml index 72c428fe933..6568b4e6050 100644 --- a/buildspec/linuxE2ETests.yml +++ b/buildspec/linuxE2ETests.yml @@ -37,8 +37,7 @@ phases: commands: - export HOME=/home/codebuild-user # Ignore failure until throttling issues are fixed. - - xvfb-run npm run testE2E - - PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports + - xvfb-run npm run testInteg; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" diff --git a/buildspec/linuxIntegrationTests.yml b/buildspec/linuxIntegrationTests.yml index a6ec2646442..da6a2531620 100644 --- a/buildspec/linuxIntegrationTests.yml +++ b/buildspec/linuxIntegrationTests.yml @@ -92,8 +92,7 @@ phases: build: commands: - export HOME=/home/codebuild-user - - xvfb-run npm run testInteg - - PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports + - xvfb-run npm run testInteg; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" From 924b90ee27bbd24244d60534a488a3b9c18e5a3f Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Tue, 17 Dec 2024 12:54:04 -0500 Subject: [PATCH 14/14] fixup --- buildspec/linuxE2ETests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec/linuxE2ETests.yml b/buildspec/linuxE2ETests.yml index 6568b4e6050..9ba5c1be9cc 100644 --- a/buildspec/linuxE2ETests.yml +++ b/buildspec/linuxE2ETests.yml @@ -37,7 +37,7 @@ phases: commands: - export HOME=/home/codebuild-user # Ignore failure until throttling issues are fixed. - - xvfb-run npm run testInteg; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports + - xvfb-run npm run testE2E; PREVIOUS_TEST_EXIT_CODE=$? npm run mergeReports - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') - CI_BUILD_ID="${CODEBUILD_BUILD_ID}"