Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix create amplify installation in canary tests #635

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/forty-students-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .eslint_dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"globals",
"grantable",
"graphql",
"homedir",
"hotswap",
"iamv2",
"identitypool",
Expand Down Expand Up @@ -124,6 +125,7 @@
"versioned",
"versioning",
"whoami",
"workspace",
"yaml",
"yargs"
]
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,22 @@ 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 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'], {
// Command must run outside of 'amplify-backend' workspace.
cwd: os.homedir(),
stdio: 'inherit',
});
Comment on lines +40 to +47
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @Amplifiyer offline. and logged #637 to seek better solution.

});

void describe('pipeline deployment', () => {
Expand Down