idf-eclipse-plugin icon indicating copy to clipboard operation
idf-eclipse-plugin copied to clipboard

fix: updated Clangd test case based on latest changes

Open AndriiFilippov opened this issue 2 months ago β€’ 1 comments

Description

Added Clangd path and query driver paths verification in the Clangd preference page.

Fixes # (IEP-XXX)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Checklist

  • [ ] PR Self Reviewed
  • [ ] Applied Code formatting
  • [ ] Added Documentation
  • [ ] Added Unit Test
  • [X] Verified on all platforms - Windows,Linux and macOS

Summary by CodeRabbit

  • Tests

    • Improved tests to explicitly verify clangd path and query driver updates for new projects.
    • Simplified flows by removing multi-step target-change and rebuild sequences for clearer, faster checks.
    • Renamed and refocused tests for clarity and maintainability.
  • Chores

    • Cleaned up test fixture setup by removing obsolete target-selector initialization, dialogs and helper utilities.

AndriiFilippov avatar Oct 23 '25 11:10 AndriiFilippov

Walkthrough

Updated a UI test: renamed the main test and helper methods, removed LaunchBar target-selector and target-change/build flows, and replaced per-target driver assertions with direct clangd path and query-driver assertions.

Changes

Cohort / File(s) Summary
Test refactor
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectClangFilesTest.java
Renamed main test and several helpers; removed LaunchBarTargetSelector field and its initialization; deleted target-dialog/selection helpers and target-change/build steps; replaced driver validations with direct clangd path and query-driver assertions via new helpers (thenCompareActualClangdPathWithExpected(), thenCompareActualQueryDriversWithExpected()); removed obsolete methods/fields and adjusted labels/strings accordingly.

Sequence Diagram(s)

(omitted β€” changes are test refactor only, no runtime control-flow changes warranting a diagram)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review focus: the single modified test file, renamed helpers, removed selector/dialog flows, and correctness of new assertion helpers.

Possibly related PRs

  • espressif/idf-eclipse-plugin#1171 β€” relates to adding/integrating clangd path updates used by the new path assertions.
  • espressif/idf-eclipse-plugin#1131 β€” modifies the same test class and related target-selection/driver verification behavior.
  • espressif/idf-eclipse-plugin#1288 β€” touches query-driver update behavior that the test now verifies differently.

Suggested reviewers

  • sigmaaa
  • kolipakakondal
  • alirana01

Poem

πŸ‡ I hopped through tests and trimmed the trail,
Old targets furl, new paths set sail.
Clangd and queries now neatly paired,
Quiet checks where fuss once flared,
Nibble, tidy β€” code well aired.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (2 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'fix: updated Clangd test case based on latest changes' accurately reflects the main changeβ€”a test case refactoring to align with updated clangd driver verification logic.
✨ Finishing touches
  • [ ] πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch IEP-1640

πŸ“œ 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 1b0a16a7b42408706fbd0fc7101e0a43b905e5c5 and af90f61c805310474865082d2370344068cff6c7.

πŸ“’ Files selected for processing (1)
  • tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectClangFilesTest.java (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectClangFilesTest.java (2)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectSDKconfigTest.java (1)
  • Fixture (78-251)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectTest.java (1)
  • Fixture (193-444)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build_macos
  • GitHub Check: build
πŸ”‡ Additional comments (3)
tests/com.espressif.idf.ui.test/src/com/espressif/idf/ui/test/executable/cases/project/NewEspressifIDFProjectClangFilesTest.java (3)

126-126: LGTM: Test method renamed to reflect simplified flow.

The new name accurately describes the test's purpose without implying build or target-change operations that are no longer part of the flow.


437-437: Verify the intent of using "Cancel" instead of "Apply and Close".

The button was changed from "Apply and Close" to "Cancel". Using "Cancel" is appropriate if the test only reads preference values without making changes. However, ensure this doesn't inadvertently skip any initialization logic that might be triggered by the "Apply" action.


129-130: Verify that clangd and query driver paths are populated without a build step.

The test now reads clangd and query driver paths directly from Eclipse preferences immediately after project creation. However, based on code analysis:

  • updateClangdPath() is only called from ToolsActivationJob, which is triggered manually via UI wizards/tool manager, not automatically on project creation
  • The original test included a build step, which may have been necessary to trigger path population
  • Without this step, the preferences dialog may not contain the expected paths

Confirm that either:

  1. Paths are auto-populated during project creation through a mechanism not yet located in the codebase
  2. The test setup or fixture properly initializes these paths before the assertions
  3. Default values from IDFClangdMetadataDefaults are sufficient for the test to pass

[!TIP]

πŸ“ Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests β€” including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. πŸ“ Description β€” Summarize the main change in 50–60 words, explaining what was done.
  2. πŸ““ References β€” List relevant issues, discussions, documentation, or related PRs.
  3. πŸ“¦ Dependencies & Requirements β€” Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. πŸ“Š Contributor Summary β€” Include a Markdown table showing contributions: | Contributor | Lines Added | Lines Removed | Files Changed |
  5. βœ”οΈ Additional Notes β€” Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Oct 23 '25 11:10 coderabbitai[bot]