Skip to content

Commit be90f93

Browse files
authored
test: wait for IAM role propagation in migration test (#14060)
* chore: support FIDO keys in CLI scripts * test: wait for policy propagation
1 parent 9ebe990 commit be90f93

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

packages/amplify-e2e-tests/src/__tests__/transformer-migrations/model-migration.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ describe('transformer model migration test', () => {
113113
await updateApiSchema(projRoot, projectName, modelSchemaV2);
114114
await amplifyPushUpdate(projRoot);
115115

116+
// Wait for 20s to ensure the newly-created roles have propagated
117+
await new Promise((resolve) => setTimeout(resolve, 20000));
118+
116119
appSyncClient = getAppSyncClientFromProj(projRoot);
117120

118121
createPostMutation = /* GraphQL */ `

scripts/cloud-cli-utils.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ function authenticate {
1111
role_name=$2
1212
profile_name=$3
1313
echo Authenticating terminal...
14-
mwinit
14+
if [[ -n $USE_FIDO_KEY ]] ; then
15+
mwinit -s -f
16+
else
17+
mwinit
18+
fi
1519
echo Loading account credentials for Account $account_number with Role: $role_name...
1620
ada cred update --profile="${profile_name}" --account="${account_number}" --role=${role_name} --provider=isengard --once
1721
aws configure set region us-east-1 --profile $profile_name

scripts/cloud-pr.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ source $scriptDir/.env set
66
printf 'What is your PR number ? '
77
read PR_NUMBER
88

9-
mwinit
9+
if [[ -n $USE_FIDO_KEY ]] ; then
10+
mwinit -s -f
11+
else
12+
mwinit
13+
fi
14+
1015
ada cred update --profile=cb-ci-account --account=$E2E_ACCOUNT_PROD --role=CodeBuildE2E --provider=isengard --once
1116
RESULT=$(aws codebuild start-build-batch \
1217
--profile=cb-ci-account \

scripts/cloud-rollback.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ source $scriptDir/.env set
66
printf 'What version should I rollback to ? '
77
read ROLLBACK_TARGET_VERSION
88

9-
mwinit
9+
if [[ -n $USE_FIDO_KEY ]] ; then
10+
mwinit -s -f
11+
else
12+
mwinit
13+
fi
14+
1015
ada cred update --profile=AmplifyCLIReleaseProd --account=$RELEASE_ACCOUNT_PROD --role=CodebuildRelease --provider=isengard --once
1116
RESULT=$(aws codebuild start-build-batch \
1217
--profile=AmplifyCLIReleaseProd \

0 commit comments

Comments
 (0)