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

test: cleanup kms tests to avoid setting incorrect keys #2213

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

ddelgrosso1
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2209 🦕

@ddelgrosso1 ddelgrosso1 requested review from a team as code owners June 6, 2023 20:28
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/nodejs-storage API. labels Jun 6, 2023
@ddelgrosso1 ddelgrosso1 added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 6, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 6, 2023
await bucket.setMetadata({
encryption: {
defaultKmsKeyName: kmsKeyName,
},
});
});

after(async () => {
afterEach(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! This is pretty clever

@@ -2551,14 +2551,17 @@ describe('storage', () => {
before(async () => {
bucket = storage.bucket(generateName(), {kmsKeyName});
await bucket.create();
});

beforeEach(async () => {
Copy link
Member

Choose a reason for hiding this comment

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

I would say try it, but you may hit update bucket metadata request limits due to
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I start to see throttling problems I will add an artificial delay to the beforeEach / afterEach functions.

@ddelgrosso1 ddelgrosso1 merged commit ee8896a into googleapis:main Jun 8, 2023
@ddelgrosso1 ddelgrosso1 deleted the kms-flaky-test branch June 8, 2023 14:07
ddelgrosso1 added a commit to ddelgrosso1/nodejs-storage that referenced this pull request Jul 6, 2023
ddelgrosso1 added a commit to ddelgrosso1/nodejs-storage that referenced this pull request Jul 12, 2023
ddelgrosso1 added a commit to ddelgrosso1/nodejs-storage that referenced this pull request Jul 24, 2023
ddelgrosso1 added a commit that referenced this pull request Jul 24, 2023
* test: cleanup kms tests to avoid setting incorrect keys (#2213)

* chore(deps): update dependency c8 to v8 (#2221)

* feat!: better typing for metadata

* more metadata typing

* fix merge problems

* remove extend

* fix merge conflicts

---------

Co-authored-by: Mend Renovate <renovate@whitesourcesoftware.com>
ddelgrosso1 added a commit that referenced this pull request Jul 24, 2023
* test: cleanup kms tests to avoid setting incorrect keys (#2213)

* chore(deps): update dependency c8 to v8 (#2221)

* feat!: better typing for metadata

* more metadata typing

* fix merge problems

* remove extend

* fix merge conflicts

---------

Co-authored-by: Mend Renovate <renovate@whitesourcesoftware.com>
ddelgrosso1 added a commit that referenced this pull request Aug 3, 2023
* refactor!: Remove `extend` and Treat Provided Options as Mutable (#2204)

* refactor: Remove `extend`

This is the prelimary, `src`-only commit.

* fix: object merging

* chore: remove log

* chore: minor clean-up

* chore: more clean-up

* refactor: remove `extend`

* perf!: treat provided options as mutable

* feat!: stronger typing for lifecycle rules (#2215)

* fix!: Do not return responsebody in delete, only raw response (#2236)

* fix!: Remove extraneous validation in favor of server errors (#2237)

* fix!: Remove extraneous validation in favor of server errors

* remove test

* refactor!: mark bucket.setLabels and associated interfaces as deprecated (#2214)

* refactor!: mark bucket.setLabels and associated interfaces as deprecated

* update addBucketLabel to use setMetadata

* mark getLabels / deleteLabels deprecated, update samples

* feat!: disable source maps for smaller bundle size (#2240)

* feat!: better typing for metadata (#2234)

* test: cleanup kms tests to avoid setting incorrect keys (#2213)

* chore(deps): update dependency c8 to v8 (#2221)

* feat!: better typing for metadata

* more metadata typing

* fix merge problems

* remove extend

* fix merge conflicts

---------

Co-authored-by: Mend Renovate <renovate@whitesourcesoftware.com>

* chore!: make node 14 the minimum version (#2230)

* chore!: make node 14 the minimum version

* move conformance test to node 14

* package upgrades, fix unit test compilation

* update google owned deps

* fix tests

* remove node 12 kokoro folders

* merge and fix issues

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* export new metadata types from index

* fix samples tests

* fix system test

---------

Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
Co-authored-by: Mend Renovate <renovate@whitesourcesoftware.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. size: s Pull request size is small.
Projects
None yet
3 participants