Skip to content

[ty] Enable pull-diagnostics by default in E2E tests#24516

Merged
MichaReiser merged 1 commit intomainfrom
micha/e2e-pull-diagnostics
Apr 9, 2026
Merged

[ty] Enable pull-diagnostics by default in E2E tests#24516
MichaReiser merged 1 commit intomainfrom
micha/e2e-pull-diagnostics

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

Publish diagnostics are a bit annoying in end to end tests because the test harness requires tests to consume all notifications.
That's why many tests awaited the publish diagnostics but then did nothing with it, resulting in unnecessary boilerplate in our tests.
Many other tests called enable_pull_diagnostics so as that they don't have to deal with this.

Given that most clients support pull diagnostics and since they're easier to work with in tests, I suggest we enable them by default in the TestServerBuilder.
Tests asserting the publish diagnostic workflow can disable pull diagnostic support by using enable_pull_diagnostic(false).

I think this helped discover a bug where ty sent a publish_diagnostic notification even for clients supporting pull diagnostics when removing a workspace folder.

Test Plan

cargo test

@MichaReiser MichaReiser added the testing Related to testing Ruff itself label Apr 9, 2026
@MichaReiser MichaReiser requested a review from Gankra as a code owner April 9, 2026 08:26
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Apr 9, 2026
@MichaReiser MichaReiser requested a review from BurntSushi as a code owner April 9, 2026 08:26
@astral-sh-bot astral-sh-bot Bot requested a review from dhruvmanila April 9, 2026 08:26
Copy link
Copy Markdown
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

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

Looks reasonable, thanks!

@MichaReiser MichaReiser force-pushed the micha/e2e-pull-diagnostics branch from 0bf35e3 to 6170ecd Compare April 9, 2026 08:36
@MichaReiser MichaReiser enabled auto-merge (squash) April 9, 2026 08:41
@MichaReiser MichaReiser merged commit 2714e34 into main Apr 9, 2026
49 checks passed
@MichaReiser MichaReiser deleted the micha/e2e-pull-diagnostics branch April 9, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants