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

update e2e test for storage access outputs #2063

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

rtpascual
Copy link
Contributor

@rtpascual rtpascual commented Sep 26, 2024

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

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the 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.

@rtpascual rtpascual requested a review from a team as a code owner September 26, 2024 23:14
Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: 891a1af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

Comment on lines 91 to 114
// 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'],
},
})
);
Copy link
Member

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.

Copy link
Contributor Author

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.

@rtpascual rtpascual added the run-e2e Label that will include e2e tests in PR checks workflow label Sep 26, 2024
@rtpascual rtpascual changed the title update backend output test for storage access outputs update e2e test for storage access outputs Sep 26, 2024
@rtpascual rtpascual merged commit b7ac6a3 into main Sep 27, 2024
55 of 58 checks passed
@rtpascual rtpascual deleted the storage-access-e2e branch September 27, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-e2e Label that will include e2e tests in PR checks workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants