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

chore: cleanup resources at startup - #1741

Merged
chalmerlowe merged 9 commits into
googleapis:mainfrom
kiraksi:cleanup-resources-at-startup
Jan 17, 2024
Merged

chore: cleanup resources at startup#1741
chalmerlowe merged 9 commits into
googleapis:mainfrom
kiraksi:cleanup-resources-at-startup

Conversation

@kiraksi

@kiraksikiraksi commented Dec 4, 2023

Copy link
Copy Markdown
Contributor

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-labelproduct-auto-labelBot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Dec 4, 2023
@kiraksikiraksi changed the title Cleanup resources at startupchore: cleanup resources at startupDec 4, 2023
Comment threadsamples/snippets/authorized_view_tutorial_test.py Outdated
@kiraksi
kiraksi marked this pull request as ready for review December 13, 2023 18:55
@kiraksi
kiraksi requested a review from a teamDecember 13, 2023 18:55
@kiraksi
kiraksi requested a review from a team as a code ownerDecember 13, 2023 18:55
@kiraksi
kiraksi requested review from a team, alvarowolfx, engelke and tswast and removed request for alvarowolfx and engelkeDecember 13, 2023 18:55
@chalmerlowe

Copy link
Copy Markdown
Collaborator

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

Comment threadsamples/snippets/authorized_view_tutorial_test.py Outdated
Comment threadsamples/snippets/dataset_access_test.py Outdated
Comment threadsamples/snippets/natality_tutorial_test.py Outdated
@chalmerlowechalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 8, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 8, 2024
@kiraksi
kiraksiforce-pushed the cleanup-resources-at-startup branch from 4704e7a to 1a9dbe6CompareJanuary 10, 2024 18:29

@chalmerlowechalmerlowe left a comment

Copy link
Copy Markdown
Collaborator

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:mainJan 17, 2024
@kiraksi
kiraksi deleted the cleanup-resources-at-startup branch January 17, 2024 20:08
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: sPull 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

@kiraksi@chalmerlowe@yoshi-kokoro