Skip to content

Make test fixtures clean up the bundle and team rows they create#69093

Merged
potiuk merged 1 commit into
apache:mainfrom
anishgirianish:fix-test-fixture-cleanup-bundles-teams
Jun 30, 2026
Merged

Make test fixtures clean up the bundle and team rows they create#69093
potiuk merged 1 commit into
apache:mainfrom
anishgirianish:fix-test-fixture-cleanup-bundles-teams

Conversation

@anishgirianish

@anishgirianish anishgirianish commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Make the database test fixtures clean up the bundle and team rows they create, in foreign-key-safe order, so tests stop leaking them. Document the fixtures and isolation pattern.

related: #68374


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@anishgirianish anishgirianish force-pushed the fix-test-fixture-cleanup-bundles-teams branch 6 times, most recently from 154d55c to fadb51b Compare June 28, 2026 04:55
@anishgirianish

Copy link
Copy Markdown
Contributor Author

cc: @ferruzzi

@goransh-buh

Copy link
Copy Markdown

Nice clean implementation. One minor thought: the early return could be moved up to reduce nesting. But overall this looks solid.

Comment thread contributing-docs/testing/unit_tests.rst
Comment thread contributing-docs/testing/unit_tests.rst

@ferruzzi ferruzzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved, assuming the cleanup steps we no longer need are going to be cleaned up in a follow-up?

Comment thread devel-common/src/tests_common/pytest_plugin.py
@ferruzzi

Copy link
Copy Markdown
Contributor

I wonder (as a future idea) if we can somehow use a pre-commit or CI test to enforce using this self-cleaning fixture to ensure we don't regress.

@anishgirianish anishgirianish force-pushed the fix-test-fixture-cleanup-bundles-teams branch 3 times, most recently from 868e056 to 17b038c Compare June 30, 2026 01:30
@anishgirianish

Copy link
Copy Markdown
Contributor Author

@ferruzzi Thank you so much for the review! Yep, I will follow up with a pr for the clear_db_* cleanup. And love the idea of the enforcement check, I'll look into it there too. thanks

@anishgirianish anishgirianish force-pushed the fix-test-fixture-cleanup-bundles-teams branch 2 times, most recently from 4cffd06 to 94c0261 Compare June 30, 2026 04:47
@anishgirianish

anishgirianish commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Test failures are not related to this pr changes, Opened diffrent pr fixing it as not related and exisits in main: #69163

@anishgirianish anishgirianish force-pushed the fix-test-fixture-cleanup-bundles-teams branch from 94c0261 to 4a9a920 Compare June 30, 2026 15:32
@anishgirianish anishgirianish force-pushed the fix-test-fixture-cleanup-bundles-teams branch from 4a9a920 to 73ab36a Compare June 30, 2026 16:39

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NICE

@potiuk potiuk merged commit 4074028 into apache:main Jun 30, 2026
145 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants