Skip to content

Commit

Permalink
Add @beta tag to create amplify in e2e tests (aws-amplify#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle authored Feb 12, 2024
1 parent 21f6292 commit 08a9e7d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .changeset/three-doors-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 6 additions & 0 deletions packages/integration-tests/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Used to run `create amplfiy` at a specific tagged release
* Remove @beta before GA to switch to running against @latest
* https://github.com/aws-amplify/amplify-backend/issues/1013
*/
export const amplifyAtTag = 'amplify@beta';
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import assert from 'assert';
import { glob } from 'glob';
import { testConcurrencyLevel } from './test_concurrency.js';
import { findBaselineCdkVersion } from '../cdk_version_finder.js';
import { amplifyAtTag } from '../constants.js';

void describe(
'create-amplify script',
Expand All @@ -31,7 +32,7 @@ void describe(
// 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'], {
await execa('npm', ['create', amplifyAtTag, '--yes', '--', '--help'], {
// Command must run outside of 'amplify-backend' workspace.
cwd: os.homedir(),
stdio: 'inherit',
Expand Down Expand Up @@ -80,7 +81,7 @@ void describe(
);
}

await execa('npm', ['create', 'amplify', '--yes'], {
await execa('npm', ['create', amplifyAtTag, '--yes'], {
cwd: tempDir,
stdio: 'inherit',
});
Expand Down Expand Up @@ -236,7 +237,7 @@ void describe(
const amplifyDirPath = path.join(tempDir, 'amplify');
await fs.mkdir(amplifyDirPath, { recursive: true });

const result = await execa('npm', ['create', 'amplify', '--yes'], {
const result = await execa('npm', ['create', amplifyAtTag, '--yes'], {
cwd: tempDir,
stdio: 'pipe',
reject: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '../process-controller/predicated_action_macros.js';
import { BackendIdentifierConversions } from '@aws-amplify/platform-core';
import { e2eToolingClientConfig } from '../e2e_tooling_client_config.js';
import { amplifyAtTag } from '../constants.js';

const cfnClient = new CloudFormationClient(e2eToolingClientConfig);

Expand All @@ -42,7 +43,7 @@ void describe('Live dependency health checks', { concurrency: 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'], {
await execa('npm', ['create', amplifyAtTag, '--yes', '--', '--help'], {
// Command must run outside of 'amplify-backend' workspace.
cwd: os.homedir(),
stdio: 'inherit',
Expand Down Expand Up @@ -77,7 +78,7 @@ void describe('Live dependency health checks', { concurrency: true }, () => {
});

void it('end to end flow', async () => {
await execa('npm', ['create', 'amplify', '--yes'], {
await execa('npm', ['create', amplifyAtTag, '--yes'], {
cwd: tempDir,
stdio: 'inherit',
});
Expand Down Expand Up @@ -114,7 +115,7 @@ void describe('Live dependency health checks', { concurrency: true }, () => {
});

void it('end to end flow', async () => {
await execa('npm', ['create', 'amplify', '--yes'], {
await execa('npm', ['create', amplifyAtTag, '--yes'], {
cwd: tempDir,
stdio: 'inherit',
});
Expand Down

0 comments on commit 08a9e7d

Please sign in to comment.