Skip to content

Commit

Permalink
Stub TestController invalidateTestResults (#12944)
Browse files Browse the repository at this point in the history
- add missing API for TestController as a stub

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu authored Sep 27, 2023
1 parent ba3722b commit 4564a4b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## v1.42.0

- [core] fixed logger level propagation when log config file changes at runtime [#12566](https://github.com/eclipse-theia/theia/pull/12566) - Contributed on behalf of STMicroelectronics
- [vscode] stub TestController invalidateTestResults [#12944](https://github.com/eclipse-theia/theia/pull/12944) - Contributed by STMicroelectronics
- [vsx-registry] added a hint to extension fetching ENOTFOUND errors [#12858](https://github.com/eclipse-theia/theia/pull/12858) - Contributed by STMicroelectronics

## v1.41.0 - 08/31/2023
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ import {
createRunProfile,
createTestRun,
testItemCollection,
createTestItem
createTestItem,
invalidateTestResults
} from './stubs/tests-api';
import { TimelineExtImpl } from './timeline';
import { ThemingExtImpl } from './theming';
Expand Down Expand Up @@ -1010,6 +1011,7 @@ export function createAPIFactory(
createRunProfile,
createTestRun,
createTestItem,
invalidateTestResults,
dispose: () => undefined,
};
},
Expand Down
4 changes: 4 additions & 0 deletions packages/plugin-ext/src/plugin/stubs/tests-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ export const createTestItem = (
range: undefined,
error: undefined,
});

export const invalidateTestResults = (
items?: theia.TestItem | readonly theia.TestItem[]
): void => undefined;
19 changes: 19 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15980,6 +15980,25 @@ export module '@theia/plugin' {
*/
createTestItem(id: string, label: string, uri?: Uri): TestItem;

/**
* Marks an item's results as being outdated. This is commonly called when
* code or configuration changes and previous results should no longer
* be considered relevant. The same logic used to mark results as outdated
* may be used to drive {@link TestRunRequest.continuous continuous test runs}.
*
* If an item is passed to this method, test results for the item and all of
* its children will be marked as outdated. If no item is passed, then all
* test owned by the TestController will be marked as outdated.
*
* Any test runs started before the moment this method is called, including
* runs which may still be ongoing, will be marked as outdated and deprioritized
* in the editor's UI.
*
* @param item Item to mark as outdated. If undefined, all the controller's items are marked outdated.
* @stubbed
*/
invalidateTestResults(items?: TestItem | readonly TestItem[]): void;

/**
* Unregisters the test controller, disposing of its associated tests
* and unpersisted results.
Expand Down

0 comments on commit 4564a4b

Please sign in to comment.