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

chore: cleanup resources at startup #1741

Merged
merged 9 commits into from
Jan 17, 2024

Conversation

kiraksi
Copy link
Contributor

@kiraksi kiraksi commented Dec 4, 2023

This PR:

  • Uses prefixer function in conftest from python-test-utils to assign IDs to datasets in samples/snippets
  • If dataset IDs already exist with the same name, those get deleted at start time
  • Primarily, this ensures that any tests that are stopped or crash do not leave dataset resources behind

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 #590 🦕

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Dec 4, 2023
@kiraksi kiraksi changed the title Cleanup resources at startup chore: cleanup resources at startup Dec 4, 2023
@kiraksi kiraksi marked this pull request as ready for review December 13, 2023 18:55
@kiraksi kiraksi requested review from a team as code owners December 13, 2023 18:55
@kiraksi kiraksi requested review from alvarowolfx, engelke and tswast and removed request for engelke and alvarowolfx December 13, 2023 18:55
@chalmerlowe
Copy link
Contributor

@kiraksi Per our discussion:

  • please figure out whether we need individual mechanisms to create prefixes in our tests OR if we can rely upon the mechanisms in conftest to do it globally.

samples/snippets/authorized_view_tutorial_test.py Outdated Show resolved Hide resolved
samples/snippets/dataset_access_test.py Outdated Show resolved Hide resolved
samples/snippets/natality_tutorial_test.py Outdated Show resolved Hide resolved
@chalmerlowe chalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 8, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 8, 2024
@kiraksi kiraksi force-pushed the cleanup-resources-at-startup branch from 4704e7a to 1a9dbe6 Compare January 10, 2024 18:29
Copy link
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

LGTM

@chalmerlowe chalmerlowe merged commit ffe8059 into googleapis:main Jan 17, 2024
19 checks passed
@kiraksi kiraksi deleted the cleanup-resources-at-startup branch January 17, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: cleanup resources at startup time in system and sample tests
3 participants