Skip to content

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Apr 30, 2025

Added tests for the bug in #10698

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-test Category - Testing. Code is missing test cases, or a PR is adding them labels Apr 30, 2025
Copy link
Member Author

Sysix commented Apr 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sysix Sysix force-pushed the 04-30-test_language_server_add_test_for_init_nested_configs_ branch from 5b30814 to a60c3fb Compare April 30, 2025 14:56
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 30, 2025

CodSpeed Instrumentation Performance Report

Merging #10728 will not alter performance

Comparing 04-30-test_language_server_add_test_for_init_nested_configs_ (5a709ad) with main (d5f66fb)

Summary

✅ 36 untouched benchmarks

@Sysix Sysix marked this pull request as ready for review April 30, 2025 14:59
@coderabbitai
Copy link

coderabbitai bot commented Apr 30, 2025

Walkthrough

This change adds new empty JSON configuration files named .oxlintrc.json at multiple nested directory levels within crates/oxc_language_server/fixtures/linter/init_nested_configs/, including the root of that directory, deep1/, and deep1/deep2/. In the Rust source code, the tester module in crates/oxc_language_server/src/linter/mod.rs is made public within the test configuration (#[cfg(test)]). Additionally, two new unit tests are added to the tests module in crates/oxc_language_server/src/worker.rs. These tests check the init_nested_configs function’s behavior when nested configs are disabled and verify that nested configuration directories are correctly identified from the test fixtures. The tests import a helper function from the now-public tester module. No other changes are made to the core logic or public API.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a60c3fb and 5a709ad.

📒 Files selected for processing (5)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/deep2/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/src/linter/mod.rs (1 hunks)
  • crates/oxc_language_server/src/worker.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/deep2/.oxlintrc.json
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/.oxlintrc.json
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/.oxlintrc.json
  • crates/oxc_language_server/src/linter/mod.rs
  • crates/oxc_language_server/src/worker.rs
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Clippy
  • GitHub Check: Test (ubuntu-latest)
  • GitHub Check: Benchmark (codegen)
  • GitHub Check: Test (macos-latest)
  • GitHub Check: Benchmark (formatter)
  • GitHub Check: Test wasm32-wasip1-threads
  • GitHub Check: Benchmark (isolated_declarations)
  • GitHub Check: Benchmark (transformer)
  • GitHub Check: Benchmark (lexer)
  • GitHub Check: Benchmark (semantic)
  • GitHub Check: Benchmark (minifier)
  • GitHub Check: Benchmark (parser)
  • GitHub Check: Build Linter Benchmark
  • GitHub Check: Test
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/oxc_language_server/src/worker.rs (1)

506-521: Test validates nested config directory detection

This test correctly verifies that init_nested_configs finds all three nested configuration directories, validating the directory hierarchy matches the expected structure.

Minor comment: The comment on line 514 "sorting the key because for consistent tests results" could be improved for clarity.

-        // sorting the key because for consistent tests results
+        // Sort the paths for consistent test results across different filesystems
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9575f6 and a60c3fb.

📒 Files selected for processing (5)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/deep2/.oxlintrc.json (1 hunks)
  • crates/oxc_language_server/src/linter/mod.rs (1 hunks)
  • crates/oxc_language_server/src/worker.rs (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
crates/oxc_language_server/src/worker.rs (1)
crates/oxc_language_server/src/linter/tester.rs (1)
  • get_file_uri (15-19)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Benchmark linter (0)
  • GitHub Check: Benchmark linter (1)
🔇 Additional comments (6)
crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/deep2/.oxlintrc.json (1)

1-2: Empty configuration file looks good

This empty JSON object serves as a test fixture for the nested configuration loading tests.

crates/oxc_language_server/fixtures/linter/init_nested_configs/deep1/.oxlintrc.json (1)

1-2: Empty configuration file looks good

This empty JSON object serves as a test fixture for the nested configuration loading tests.

crates/oxc_language_server/fixtures/linter/init_nested_configs/.oxlintrc.json (1)

1-2: Empty configuration file looks good

This empty JSON object serves as a test fixture for the nested configuration loading tests.

crates/oxc_language_server/src/linter/mod.rs (1)

7-7: Visibility change enables test access

Making the tester module public enables the tests to properly import and use the get_file_uri helper function.

crates/oxc_language_server/src/worker.rs (2)

462-463: Import added for test utility function

Adding the import for get_file_uri properly supports the newly added tests.


493-504: Test correctly verifies disabled nested configs behavior

This test verifies that when the disable_nested_configs flag is set to "true", the init_nested_configs function returns an empty map. This is a good test case to ensure the flag properly disables nested config loading.

@Sysix Sysix added the 0-merge Merge with Graphite Merge Queue label Apr 30, 2025
Copy link
Member Author

Sysix commented Apr 30, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 04-30-test_language_server_add_test_for_init_nested_configs_ branch from a60c3fb to 5a709ad Compare April 30, 2025 22:27
@graphite-app graphite-app bot merged commit 5a709ad into main Apr 30, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 04-30-test_language_server_add_test_for_init_nested_configs_ branch April 30, 2025 22:30
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants