Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

test: Add autogenerated tests to prepare for a refactor PR#1092

Merged
danieljbruce merged 8 commits intogoogleapis:mainfrom
danieljbruce:autoscaler-refactor
Jun 17, 2022
Merged

test: Add autogenerated tests to prepare for a refactor PR#1092
danieljbruce merged 8 commits intogoogleapis:mainfrom
danieljbruce:autoscaler-refactor

Conversation

@danieljbruce
Copy link
Copy Markdown
Contributor

The only thing this PR does is add tests with automatically generated snapshots that capture the data that will be sent to the generated layer. There should be no functionality changes to code in the src folder.

The main reason for creating these autogenerated snapshots is that next I will open a technical debt PR which refactors code and we want to be sure that when we do that refactor, we don't actually change what the code does. Comparing variable values to these previously generated snapshots will allow us to do this to ensure data being passed to the generated layer remains unchanged. If there are subtle changes then we will see the difference in the snapshot in the tech debt PR and we can check with team members that manage code server side to ensure the changes won't break anything.

@danieljbruce danieljbruce requested review from a team June 1, 2022 15:33
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/nodejs-bigtable API. labels Jun 1, 2022
@bcoe bcoe added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 3, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 3, 2022
Copy link
Copy Markdown

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

This seems like a great use of snapshots, I left one suggestion that I think will make maintenance easier.

Comment thread package.json
"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.0",
"sinon": "^14.0.0",
"snap-shot-it": "^7.9.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would add an additional npm script that allows you to take snapshots retake snapshots, otherwise if the structure of responses changes in the future someone needs to read the docs for snap-shot-it, something like:

{"scripts: {
  "test:snap": "COMMAND TO TAKE SNAPSHOT"
}}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Script added.

Copy link
Copy Markdown
Contributor Author

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

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

First PR follow-up

Comment thread package.json
"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.0",
"sinon": "^14.0.0",
"snap-shot-it": "^7.9.1",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Script added.

@kolea2 kolea2 changed the title feat: Add autogenerated tests to prepare for a refactor PR test: Add autogenerated tests to prepare for a refactor PR Jun 17, 2022
@danieljbruce danieljbruce added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 17, 2022
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 17, 2022
@danieljbruce danieljbruce merged commit 1a2e3fb into googleapis:main Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigtable Issues related to the googleapis/nodejs-bigtable API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants