Skip to content

chore(tests): Add database cleanup functions#1528

Merged
Myst9 merged 5 commits into
mainfrom
test-cleanup
Sep 30, 2025
Merged

chore(tests): Add database cleanup functions#1528
Myst9 merged 5 commits into
mainfrom
test-cleanup

Conversation

@Myst9

@Myst9 Myst9 commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Description


This change adds helper functions to cleanup the test databases (PostgreSQL, MySQL, and MSSQL) by dropping any orphan tables from previous test runs. These functions can be called at the beginning of each test run.

PR Checklist


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 you reviewed
    CONTRIBUTING.md
  • 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)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #1304

@Myst9 Myst9 force-pushed the test-cleanup branch 2 times, most recently from 00870e1 to 11b76d2 Compare September 22, 2025 05:16
@Myst9 Myst9 marked this pull request as ready for review September 22, 2025 05:35
@Myst9 Myst9 requested a review from a team September 22, 2025 05:35
Comment thread tests/common.go
@Myst9 Myst9 merged commit 918753d into main Sep 30, 2025
11 checks passed
@Myst9 Myst9 deleted the test-cleanup branch September 30, 2025 03:27
rahulpinto19 pushed a commit that referenced this pull request Sep 30, 2025
## Description

---
This change adds helper functions to cleanup the test databases
(PostgreSQL, MySQL, and MSSQL) by dropping any orphan tables from
previous test runs. These functions can be called at the beginning of
each test run.

## PR Checklist

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

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1304

---------

Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests do not clean up database tables from previous runs

2 participants