@theia/test 1.53.0-next.4 → 1.53.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/view/test-view-contribution.d.ts +1 -0
- package/lib/browser/view/test-view-contribution.d.ts.map +1 -1
- package/lib/browser/view/test-view-contribution.js +10 -1
- package/lib/browser/view/test-view-contribution.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/constants.ts +71 -71
- package/src/browser/style/index.css +41 -41
- package/src/browser/test-execution-progress-service.ts +53 -53
- package/src/browser/test-preferences.ts +58 -58
- package/src/browser/test-service.ts +402 -402
- package/src/browser/view/test-context-key-service.ts +36 -36
- package/src/browser/view/test-execution-state-manager.ts +147 -147
- package/src/browser/view/test-output-ui-model.ts +156 -156
- package/src/browser/view/test-output-view-contribution.ts +34 -34
- package/src/browser/view/test-output-widget.ts +148 -148
- package/src/browser/view/test-result-view-contribution.ts +34 -34
- package/src/browser/view/test-result-widget.ts +92 -92
- package/src/browser/view/test-run-view-contribution.ts +89 -89
- package/src/browser/view/test-run-widget.tsx +271 -271
- package/src/browser/view/test-tree-widget.tsx +360 -360
- package/src/browser/view/test-view-contribution.ts +328 -319
- package/src/browser/view/test-view-frontend-module.ts +136 -136
- package/src/common/collections.ts +223 -223
- package/src/common/tree-delta.spec.ts +166 -166
- package/src/common/tree-delta.ts +259 -259
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 STMicroelectronics and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { AbstractViewContribution, Widget } from '@theia/core/lib/browser';
|
|
18
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { TestRun, TestService } from '../test-service';
|
|
20
|
-
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
21
|
-
import { TestRunTreeWidget } from './test-run-widget';
|
|
22
|
-
import { TEST_VIEW_CONTAINER_ID, TestViewCommands } from './test-view-contribution';
|
|
23
|
-
import { CommandRegistry, MenuModelRegistry, nls } from '@theia/core';
|
|
24
|
-
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
25
|
-
|
|
26
|
-
export const TEST_RUNS_CONTEXT_MENU = ['test-runs-context-menu'];
|
|
27
|
-
export const TEST_RUNS_INLINE_MENU = [...TEST_RUNS_CONTEXT_MENU, 'inline'];
|
|
28
|
-
|
|
29
|
-
@injectable()
|
|
30
|
-
export class TestRunViewContribution extends AbstractViewContribution<TestRunTreeWidget> implements TabBarToolbarContribution {
|
|
31
|
-
|
|
32
|
-
@inject(TestService) protected readonly testService: TestService;
|
|
33
|
-
@inject(ContextKeyService) protected readonly contextKeys: ContextKeyService;
|
|
34
|
-
|
|
35
|
-
constructor() {
|
|
36
|
-
super({
|
|
37
|
-
viewContainerId: TEST_VIEW_CONTAINER_ID,
|
|
38
|
-
widgetId: TestRunTreeWidget.ID,
|
|
39
|
-
widgetName: nls.localize('theia/test/testRuns', 'Test Runs'),
|
|
40
|
-
defaultWidgetOptions: {
|
|
41
|
-
area: 'left',
|
|
42
|
-
rank: 200,
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
|
48
|
-
registry.registerItem({
|
|
49
|
-
id: TestViewCommands.CLEAR_ALL_RESULTS.id,
|
|
50
|
-
command: TestViewCommands.CLEAR_ALL_RESULTS.id,
|
|
51
|
-
priority: 1
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
override registerMenus(menus: MenuModelRegistry): void {
|
|
56
|
-
super.registerMenus(menus);
|
|
57
|
-
menus.registerMenuAction(TEST_RUNS_CONTEXT_MENU, {
|
|
58
|
-
commandId: TestViewCommands.CANCEL_RUN.id
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
override registerCommands(commands: CommandRegistry): void {
|
|
63
|
-
super.registerCommands(commands);
|
|
64
|
-
commands.registerCommand(TestViewCommands.CANCEL_RUN, {
|
|
65
|
-
isEnabled: t => TestRun.is(t) && t.isRunning,
|
|
66
|
-
isVisible: t => TestRun.is(t),
|
|
67
|
-
execute: t => {
|
|
68
|
-
if (TestRun.is(t)) {
|
|
69
|
-
t.cancel();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
commands.registerCommand(TestViewCommands.CLEAR_ALL_RESULTS, {
|
|
75
|
-
isEnabled: w => this.withWidget(w, () => true),
|
|
76
|
-
isVisible: w => this.withWidget(w, () => true),
|
|
77
|
-
execute: () => {
|
|
78
|
-
this.testService.clearResults();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
protected withWidget<T>(widget: Widget | undefined = this.tryGetWidget(), cb: (widget: TestRunTreeWidget) => T): T | false {
|
|
84
|
-
if (widget instanceof TestRunTreeWidget && widget.id === TestRunTreeWidget.ID) {
|
|
85
|
-
return cb(widget);
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 STMicroelectronics and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { AbstractViewContribution, Widget } from '@theia/core/lib/browser';
|
|
18
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { TestRun, TestService } from '../test-service';
|
|
20
|
+
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
21
|
+
import { TestRunTreeWidget } from './test-run-widget';
|
|
22
|
+
import { TEST_VIEW_CONTAINER_ID, TestViewCommands } from './test-view-contribution';
|
|
23
|
+
import { CommandRegistry, MenuModelRegistry, nls } from '@theia/core';
|
|
24
|
+
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
25
|
+
|
|
26
|
+
export const TEST_RUNS_CONTEXT_MENU = ['test-runs-context-menu'];
|
|
27
|
+
export const TEST_RUNS_INLINE_MENU = [...TEST_RUNS_CONTEXT_MENU, 'inline'];
|
|
28
|
+
|
|
29
|
+
@injectable()
|
|
30
|
+
export class TestRunViewContribution extends AbstractViewContribution<TestRunTreeWidget> implements TabBarToolbarContribution {
|
|
31
|
+
|
|
32
|
+
@inject(TestService) protected readonly testService: TestService;
|
|
33
|
+
@inject(ContextKeyService) protected readonly contextKeys: ContextKeyService;
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
super({
|
|
37
|
+
viewContainerId: TEST_VIEW_CONTAINER_ID,
|
|
38
|
+
widgetId: TestRunTreeWidget.ID,
|
|
39
|
+
widgetName: nls.localize('theia/test/testRuns', 'Test Runs'),
|
|
40
|
+
defaultWidgetOptions: {
|
|
41
|
+
area: 'left',
|
|
42
|
+
rank: 200,
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
|
48
|
+
registry.registerItem({
|
|
49
|
+
id: TestViewCommands.CLEAR_ALL_RESULTS.id,
|
|
50
|
+
command: TestViewCommands.CLEAR_ALL_RESULTS.id,
|
|
51
|
+
priority: 1
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override registerMenus(menus: MenuModelRegistry): void {
|
|
56
|
+
super.registerMenus(menus);
|
|
57
|
+
menus.registerMenuAction(TEST_RUNS_CONTEXT_MENU, {
|
|
58
|
+
commandId: TestViewCommands.CANCEL_RUN.id
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
override registerCommands(commands: CommandRegistry): void {
|
|
63
|
+
super.registerCommands(commands);
|
|
64
|
+
commands.registerCommand(TestViewCommands.CANCEL_RUN, {
|
|
65
|
+
isEnabled: t => TestRun.is(t) && t.isRunning,
|
|
66
|
+
isVisible: t => TestRun.is(t),
|
|
67
|
+
execute: t => {
|
|
68
|
+
if (TestRun.is(t)) {
|
|
69
|
+
t.cancel();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
commands.registerCommand(TestViewCommands.CLEAR_ALL_RESULTS, {
|
|
75
|
+
isEnabled: w => this.withWidget(w, () => true),
|
|
76
|
+
isVisible: w => this.withWidget(w, () => true),
|
|
77
|
+
execute: () => {
|
|
78
|
+
this.testService.clearResults();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
protected withWidget<T>(widget: Widget | undefined = this.tryGetWidget(), cb: (widget: TestRunTreeWidget) => T): T | false {
|
|
84
|
+
if (widget instanceof TestRunTreeWidget && widget.id === TestRunTreeWidget.ID) {
|
|
85
|
+
return cb(widget);
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|