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

Add pnpm command to update snapshot #1647

Merged

Conversation

aurelius0523
Copy link
Contributor

@aurelius0523 aurelius0523 commented Sep 3, 2024

Overview

Add a new pnpm test:template:updateSnapshot script

What it does

It leverages existing update-template.sh and adds a -u option to update snapshot. It will update existing snapshots when running tests in tmp-${template} dir and copy the snapshots to skuba/template dir

Why

To make it easier to avoid #1646 because I missed it in #1644

Further thoughts

I initially thought to make pnpm test:template --updateSnapshot by default but I am unsure of the existing approach. Assuming that snapshots in template are meant as safeguard for template user and not skuba developers, it might be easier to just have a husky pre-commit hook to --updateSnapshot by default when modifying templates.

@aurelius0523 aurelius0523 requested a review from a team as a code owner September 3, 2024 12:29
Copy link

changeset-bot bot commented Sep 3, 2024

⚠️ No Changeset found

Latest commit: b5e98ef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@AaronMoat AaronMoat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was silly and force merged when I shouldn't have. I think I thought they were failing from the fork, but looking at the build again it seems fairly obvious why it failed.

But: For development this is FANTASTIC, thank you!

I believe the snapshots for the CDK template are actually intended for the developer (as well); if a developer takes the template, makes changes, and so on - it's nice to get a diff in the tests / PR for what infrastructure is changing. There are of course other ways we could do this (e.g. staging a changeset)

@aurelius0523 aurelius0523 merged commit 3f41357 into seek-oss:main Sep 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants