Skip to content

Rewrite sqlfluff integration tests#22099

Open
grihabor wants to merge 1 commit intopantsbuild:mainfrom
grihabor:rewrite-sqlfluff-tests
Open

Rewrite sqlfluff integration tests#22099
grihabor wants to merge 1 commit intopantsbuild:mainfrom
grihabor:rewrite-sqlfluff-tests

Conversation

@grihabor
Copy link
Contributor

@grihabor grihabor commented Mar 17, 2025

Integration tests for sqlfluff are not true integration tests right now. They call LintRequest rules, but that skips the partitioning step. I need to test partitioning in #21937, so I had to rewrite the tests.

Integration tests for sqlfluff are not true integration tests right now.
They call LintRequest rules, but that skips the partitioning step. I
need to test partitioning in
pantsbuild#21937, so I had to rewrite the
tests.
Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

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

Thanks for maintaining this backend.

Switching to run_pants makes the tests quite a bit slower: they're now hitting the 60s timeout on CI, and a n=1 test goes from 50s to 104s locally.

I think it would be good to consider a middle ground, where:

  • most tests use the lighter-weight direct invocation of rules (most of our *_integration_test.py files do this even for integration tests, I think the rule of thumb is an "integration test" uses a scheduler and invokes rules, even with some mocking, whereas non-integration tests just invoke functions without needing a scheduler)
  • a few tests do full run_pants where required (such as those that need to test partitioning etc. end to end)

For testing partitioning, I think one can also test the partitioning rules directly, to handle all the subtleties, and have one or two run_pants tests that suggest it's all hooked up correctly.

What do you think?

@huonw huonw added the release-notes:not-required [CI] PR doesn't require mention in release notes label Apr 15, 2025
@grihabor
Copy link
Contributor Author

@huonw Thank you for review! Well, I'd like to keep the integration tests, but if it's too slow I'm ok to switch to only rule based tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants