Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance LSP Testing Strategy for Better Reliability #5764

Merged
merged 5 commits into from
Mar 25, 2024
Merged

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Mar 25, 2024

Description

This PR refines our testing approach for sway-lsp to ensure tests run sequentially, addressing potential async test interference. Key enhancements include:

  • Implemented a run_async macro to facilitate running async tests within a synchronous environment, minimizing the boilerplate code and improving test readability.
  • Updated the GitHub Actions workflow to include a dedicated job for sway-lsp, utilizing -p sway-lsp -- --test-threads=1 to enforce sequential execution of tests. This removes LSP tests from the cargo-test-workspace job.

@JoshuaBatty JoshuaBatty self-assigned this Mar 25, 2024
@JoshuaBatty JoshuaBatty marked this pull request as draft March 25, 2024 04:33
@JoshuaBatty JoshuaBatty marked this pull request as ready for review March 25, 2024 04:53
@JoshuaBatty JoshuaBatty requested review from a team March 25, 2024 04:54
Copy link

Benchmark for 8858254

Click to view benchmark
Test Base PR %
code_action 5.3±0.04ms 5.3±0.17ms 0.00%
code_lens 296.0±11.13ns 292.5±10.91ns -1.18%
compile 6.1±0.09s 6.2±0.09s +1.64%
completion 4.9±0.07ms 5.0±0.16ms +2.04%
did_change_with_caching 5.5±0.04s 5.7±0.11s +3.64%
document_symbol 1059.6±8.36µs 1019.0±41.28µs -3.83%
format 70.7±1.07ms 71.2±0.98ms +0.71%
goto_definition 366.7±6.27µs 371.4±4.02µs +1.28%
highlight 8.8±0.20ms 8.8±0.06ms 0.00%
hover 603.0±12.34µs 691.0±20.33µs +14.59%
idents_at_position 122.8±0.32µs 125.3±0.54µs +2.04%
inlay_hints 647.0±21.81µs 658.0±25.86µs +1.70%
on_enter 492.7±29.94ns 484.3±12.98ns -1.70%
parent_decl_at_position 3.6±0.05ms 3.6±0.04ms 0.00%
prepare_rename 363.8±5.04µs 365.2±6.80µs +0.38%
rename 9.2±0.06ms 9.3±0.40ms +1.09%
semantic_tokens 1014.5±13.88µs 1053.3±21.96µs +3.82%
token_at_position 361.9±3.95µs 366.2±2.28µs +1.19%
tokens_at_position 3.6±0.07ms 3.6±0.03ms 0.00%
tokens_for_file 417.5±1.79µs 420.1±10.13µs +0.62%
traverse 44.8±1.95ms 45.9±1.59ms +2.46%

@JoshuaBatty JoshuaBatty enabled auto-merge (squash) March 25, 2024 05:20
@JoshuaBatty JoshuaBatty requested a review from a team March 25, 2024 09:17
@JoshuaBatty JoshuaBatty merged commit c02d50c into master Mar 25, 2024
36 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/lsp_tests branch March 25, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants