Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

chore(docs): Securing tests against leaks. #139

Merged
merged 6 commits into from Nov 3, 2021
Merged

chore(docs): Securing tests against leaks. #139

merged 6 commits into from Nov 3, 2021

Conversation

m-strzelczyk
Copy link
Contributor

Fixes #138 馃

@product-auto-label product-auto-label bot added the api: compute Issues related to the googleapis/python-compute API. label Oct 22, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 22, 2021
@m-strzelczyk m-strzelczyk marked this pull request as ready for review October 25, 2021 12:57
@m-strzelczyk m-strzelczyk requested a review from a team as a code owner October 25, 2021 12:57
@m-strzelczyk
Copy link
Contributor Author

After long battle with GCE Enforcer that I described in #138 I came to conclusion that the only way to get this test to work for now is to use one of the existing subnetworks, so I did that.

@m-strzelczyk
Copy link
Contributor Author

@googleapis/python-samples-owners please review, as this is blocking other PRs and makes sample tests leak VPC networks.

@m-strzelczyk
Copy link
Contributor Author

This is blocking #134 and #136

@m-strzelczyk m-strzelczyk merged commit 6248fdd into main Nov 3, 2021
@m-strzelczyk m-strzelczyk deleted the issue-138 branch November 3, 2021 15:05
wait_for_operation(op, PROJECT)
try:
image = image_client.get(project=PROJECT, image=image.name)
request.cls.image = image
Copy link
Contributor

Choose a reason for hiding this comment

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

@m-strzelczyk Non-blocking question: What's the benefit of using fixtures at the class scope instead of at the module scope for these tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a bit faster. I don't create a new disk/image/snapshot for every test. As those are used in read-only way I can share them between the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry, didn't notice you mentioned module scope. This would work as well, I just picked the class scope because I found the example for it :P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: compute Issues related to the googleapis/python-compute API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VPC network leakage in sample tests
3 participants