Skip to content

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
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 a review from a team as a code owner June 1, 2022 15:33
@danieljbruce danieljbruce requested a 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

@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.

"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.0",
"sinon": "^14.0.0",
"snap-shot-it": "^7.9.1",
Copy link

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
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
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

"pack-n-play": "^1.0.0-2",
"proxyquire": "^2.0.0",
"sinon": "^14.0.0",
"snap-shot-it": "^7.9.1",
Copy link
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 join this conversation on GitHub. Already have an account? Sign in to comment

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