From cd3dca019696afce56323c0c3e912d9a3ce96171 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 13 Nov 2023 08:19:55 -0800 Subject: [PATCH 1/4] test: fix create amplify installation in canary tests --- .../health_checks.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts index b734b398b7..8ed8324dd3 100644 --- a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts +++ b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts @@ -29,13 +29,20 @@ const cfnClient = new CloudFormationClient(); */ void describe('Live dependency health checks', { concurrency: true }, () => { before(async () => { - // nuke the npx cache to ensure we are installing latest versions of packages from the npm + // Nuke the npx cache to ensure we are installing latest versions of packages from the npm. const { stdout } = await execa('npm', ['config', 'get', 'cache']); const npxCacheLocation = path.join(stdout.toString().trim(), '_npx'); if (existsSync(npxCacheLocation)) { await fs.rm(npxCacheLocation, { recursive: true }); } + + // Force 'create-amplify' installation in npm cache by executing help command + // before tests run. Otherwise, installing 'create-amplify' concurrently + // may lead to race conditions and corrupted npx cache. + await execa('npm', ['create', 'amplify', '--yes', '--', '--help'], { + stdio: 'inherit', + }); }); void describe('pipeline deployment', () => { From 84af55485460fe3c0938eedaae69e2bf2eaa63ba Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 13 Nov 2023 08:25:12 -0800 Subject: [PATCH 2/4] test: fix create amplify installation in canary tests --- .changeset/forty-students-attend.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/forty-students-attend.md diff --git a/.changeset/forty-students-attend.md b/.changeset/forty-students-attend.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/forty-students-attend.md @@ -0,0 +1,2 @@ +--- +--- From cf8dc30bc9f14b7c46b9804a8fb69323bdb02540 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 13 Nov 2023 08:44:02 -0800 Subject: [PATCH 3/4] test: fix create amplify installation in canary tests --- .eslint_dictionary.json | 2 ++ .../test-live-dependency-health-checks/health_checks.test.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.eslint_dictionary.json b/.eslint_dictionary.json index cbc5ef2ebb..7ce59076a6 100644 --- a/.eslint_dictionary.json +++ b/.eslint_dictionary.json @@ -43,6 +43,7 @@ "globals", "grantable", "graphql", + "homedir", "hotswap", "iamv2", "identitypool", @@ -124,6 +125,7 @@ "versioned", "versioning", "whoami", + "workspace", "yaml", "yargs" ] diff --git a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts index 8ed8324dd3..0f17e84d0c 100644 --- a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts +++ b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts @@ -41,6 +41,8 @@ void describe('Live dependency health checks', { concurrency: true }, () => { // before tests run. Otherwise, installing 'create-amplify' concurrently // may lead to race conditions and corrupted npx cache. await execa('npm', ['create', 'amplify', '--yes', '--', '--help'], { + // Command must run outside of 'amplify-backend' workspace. + cwd: os.homedir(), stdio: 'inherit', }); }); From 80de5ea90659e1a0e88779c0c5f856c0599deb91 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 13 Nov 2023 08:48:23 -0800 Subject: [PATCH 4/4] test: fix create amplify installation in canary tests --- .../test-live-dependency-health-checks/health_checks.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts index 0f17e84d0c..52bcfa30fa 100644 --- a/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts +++ b/packages/integration-tests/src/test-live-dependency-health-checks/health_checks.test.ts @@ -37,7 +37,7 @@ void describe('Live dependency health checks', { concurrency: true }, () => { await fs.rm(npxCacheLocation, { recursive: true }); } - // Force 'create-amplify' installation in npm cache by executing help command + // Force 'create-amplify' installation in npx cache by executing help command // before tests run. Otherwise, installing 'create-amplify' concurrently // may lead to race conditions and corrupted npx cache. await execa('npm', ['create', 'amplify', '--yes', '--', '--help'], {