Файли
openidea/plugins/official/test-runner
Ainul YaqinтаAkin01 e08531c458 feat(plugins): project-scoped debounce and supersession for plugin refresh work (API 1.18) (#5002)
events.subscribe-paths-with-options adds an optional debounce-ms (up to 5 s) that coalesces files-changed deltas on the host, so bursts of edits don't run a plugin's discovery again and again. workspace.project.generation returns a project's state generation, which moves on every file change; FilesChanged carries the project root and generation. Registering run targets or run configurations computed for a superseded generation fails with Error::Stale. A new project-closed event tells subscribed plugins a project closed after its queued events are dropped and its run targets and configurations are withdrawn.

On top of the contributor's work: closing one project no longer cancels a plugin instance's in-flight work for other projects (an instance serves every project; results for the closed one are refused because its generation moved on), the generation is bumped on close, the generation is attached only for plugins declaring API 1.18 so older plugins' registrations are never refused, and the API now ships as part of 1.18 with the components rebuilt.

Closes #4760

Co-authored-by: Akin01 <[email protected]>
2026-11-26 20:41:06 +08:00
..

test-runner — API 1.4 example

Put this directory on PATH before installing/granting the plugin, so process:openidea-example-tests resolves to the included executable. Copy example.tests to a trusted project. Its presence enables the dynamic run-configurations export. Open it as plain text and click a gutter run button, or use Example: Run Tests / the Run selector for all tests.

The gutter command appends the test name as a filter to run.start. The fake executable prints a deliberately tiny start NAME / pass NAME protocol; test-results.parse retains split lines and emits stable test ids. Replace that protocol/parser and executable to integrate a real framework. This is an API example for integrating a test framework.

Build from the repository root:

plugins/build.sh official/test-runner
cargo test --manifest-path plugins/official/test-runner/Cargo.toml
cargo run -p ide-host --bin openidea-plugin -- check plugins/official/test-runner

Install the built package folder through Settings › Plugins › Install from Disk. See the plugin guide and official/community policy.

test-results.select-tests returns the selected names as the complete argv for openidea-example-tests, enabling Rerun Failed Tests and Run from the test tree. It returns None for unknown configurations or paths this example cannot filter.