-
Notifications
You must be signed in to change notification settings - Fork 72
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
update e2e test for storage access outputs #2063
Conversation
🦋 Changeset detectedLatest commit: 891a1af The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// assert storage access paths are correct in stack outputs | ||
const outputsObject = JSON.parse( | ||
await fsp.readFile( | ||
path.join(testProject.projectDirPath, 'amplify_outputs.json'), | ||
'utf-8' | ||
) | ||
); | ||
assert.ok( | ||
isMatch(outputsObject.storage.buckets[0].paths, { | ||
'public/*': { | ||
guest: ['get', 'list'], | ||
authenticated: ['get', 'list', 'write'], | ||
groupsAdmins: ['get', 'list', 'write', 'delete'], | ||
}, | ||
'protected/*': { | ||
authenticated: ['get', 'list'], | ||
groupsAdmins: ['get', 'list', 'write', 'delete'], | ||
}, | ||
'protected/${cognito-identity.amazonaws.com:sub}/*': { | ||
// eslint-disable-next-line spellcheck/spell-checker | ||
entityidentity: ['get', 'list', 'write', 'delete'], | ||
}, | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right place for this assertion ? I recall we use this test to assure that we can read outputs from project deployed with N-1 version/commit.
I'd rather see it in packages/integration-tests/src/test-project-setup/data_storage_auth_with_triggers.ts
post deployment section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I forgot the intention of this e2e test.
I'll add a comment at the top explaining what this test is for to prevent confusion in the future and move this assertion to post deployment you mentioned.
Changes
Follow up from this thread #1927 (comment). Added assertions to check shape of storage paths output.
Corresponding docs PR, if applicable:
Validation
e2e test
Checklist
run-e2e
label set.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.