diff --git a/packages/amplify-migration-e2e/src/__tests__/migration_codegen_e2e.test.ts b/packages/amplify-migration-e2e/src/__tests__/migration_codegen_e2e.test.ts index 11a2231f87..48e2ee0277 100644 --- a/packages/amplify-migration-e2e/src/__tests__/migration_codegen_e2e.test.ts +++ b/packages/amplify-migration-e2e/src/__tests__/migration_codegen_e2e.test.ts @@ -60,8 +60,10 @@ void describe('Codegen E2E tests', () => { await runCodegenCommand(projRoot); await copyFunctionFile(projRoot, 'function', gen1FunctionName); await copyGen1Schema(projRoot, projName); + // TODO: replace below line with correct package version - await updatePackageDependency(projRoot, '@aws-amplify/backend', '0.0.0-test-20241003180022'); + await updatePackageDependency(projRoot, '@aws-amplify/backend'); + await npmInstall(projRoot); const gen2StackName = await runGen2SandboxCommand(projRoot); await assertAuthResource(projRoot, gen1UserPoolId, gen1ClientIds, gen1IdentityPoolId, gen1Region); @@ -78,8 +80,10 @@ void describe('Codegen E2E tests', () => { await runCodegenCommand(projRoot); await copyFunctionFile(projRoot, 'auth', gen1FunctionName); await removeErrorThrowsFromAuthResourceFile(projRoot); + // TODO: replace below line with correct package version - await updatePackageDependency(projRoot, '@aws-amplify/backend', '0.0.0-test-20241003180022'); + await updatePackageDependency(projRoot, '@aws-amplify/backend'); + await npmInstall(projRoot); await toggleSandboxSecrets(projRoot, 'set'); const gen2StackName = await runGen2SandboxCommand(projRoot); @@ -94,8 +98,10 @@ void describe('Codegen E2E tests', () => { projRoot, ); await runCodegenCommand(projRoot); + // TODO: replace below line with correct package version - await updatePackageDependency(projRoot, '@aws-amplify/backend', '0.0.0-test-20241003180022'); + await updatePackageDependency(projRoot, '@aws-amplify/backend'); + await npmInstall(projRoot); await runGen2SandboxCommand(projRoot); await assertAuthResource(projRoot, gen1UserPoolId, gen1ClientIds, gen1IdentityPoolId, gen1Region); diff --git a/packages/amplify-migration-e2e/src/migrationReadmeParser.ts b/packages/amplify-migration-e2e/src/migrationReadmeParser.ts index 91277e9988..510addc311 100644 --- a/packages/amplify-migration-e2e/src/migrationReadmeParser.ts +++ b/packages/amplify-migration-e2e/src/migrationReadmeParser.ts @@ -24,6 +24,26 @@ function extractCommands(readmeContent: string) { return commands; } +/** + * Sample from the README file for STEP 1: + * + * ### STEP 1: UPDATE GEN-1 AUTH STACK + * + * It is a non-disruptive update since the template only replaces resource references with their resolved values. This is a required step to execute cloudformation stack refactor later. + * + * ``` + * aws cloudformation update-stack \ + * --stack-name my-auth-stack-name \ + * --template-body file://path/to/template.json \ + * --parameters '[{"ParameterKey":"authRoleArn","ParameterValue":"arn:aws:iam::123456789012:role/my-auth-role"},{"ParameterKey":"autoVerifiedAttributes","ParameterValue":"email"},{"ParameterKey":"allowUnauthenticatedIdentities","ParameterValue":"false"},{"ParameterKey":"smsVerificationMessage","ParameterValue":"Your verification code is {####}"}]' \ + * --capabilities CAPABILITY_NAMED_IAM --tags '[]' + * ``` + * + * ``` + * aws cloudformation describe-stacks \ + * --stack-name my-auth-stack-name + * ``` + */ export function getCommandsFromReadme(readmeContent: string) { const step1Content = extractContent(readmeContent, '### STEP 1', '#### Rollback step'); const step2Content = extractContent(readmeContent, '### STEP 2', '#### Rollback step');