Skip to content

Commit 7c08d62

Browse files
committed
[WIP] - Debug test modification tests
1 parent da07bbd commit 7c08d62

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

.vscode-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = defineConfig({
7474
ui: "tdd",
7575
color: true,
7676
timeout,
77-
forbidOnly: isCIBuild,
77+
forbidOnly: false, // isCIBuild,
7878
grep: isFastTestRun ? "@slow" : undefined,
7979
invert: isFastTestRun,
8080
slow: 10000,
@@ -110,7 +110,7 @@ module.exports = defineConfig({
110110
ui: "tdd",
111111
color: true,
112112
timeout,
113-
forbidOnly: isCIBuild,
113+
forbidOnly: false, //isCIBuild,
114114
grep: isFastTestRun ? "@slow" : undefined,
115115
invert: isFastTestRun,
116116
slow: 10000,
@@ -134,7 +134,7 @@ module.exports = defineConfig({
134134
ui: "tdd",
135135
color: true,
136136
timeout,
137-
forbidOnly: isCIBuild,
137+
forbidOnly: false, //isCIBuild,
138138
slow: 100,
139139
reporter: path.join(__dirname, ".mocha-reporter.js"),
140140
reporterOptions: {

src/TestExplorer/LSPTestDiscovery.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class LSPTestDiscovery {
4343
swiftPackage: SwiftPackage,
4444
document: vscode.Uri
4545
): Promise<TestDiscovery.TestClass[]> {
46+
console.log(">>> LSPTestDiscovery.getDocumentTests", document.toString());
4647
return await this.languageClient.useLanguageClient(async (client, token) => {
4748
// Only use the lsp for this request if it supports the
4849
// textDocument/tests method, and is at least version 2.

src/TestExplorer/TestExplorer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,17 @@ export class TestExplorer {
206206
) {
207207
const uri = document?.uri;
208208
const testExplorer = folder?.testExplorer;
209+
console.log(">>> On Document Symbols 1", testExplorer, symbols, uri, uri.scheme);
209210
if (testExplorer && symbols && uri && uri.scheme === "file") {
211+
console.log(
212+
">>> On Document Symbols 2",
213+
document.uri.toString(),
214+
isPathInsidePath(uri.fsPath, folder.folder.fsPath)
215+
);
210216
if (isPathInsidePath(uri.fsPath, folder.folder.fsPath)) {
217+
console.log(">>> On Document Symbols 3", document.uri.toString());
211218
void folder.swiftPackage.getTarget(uri.fsPath).then(target => {
219+
console.log(">>> On Document Symbols 4", document.uri.toString());
212220
if (target && target.type === "test") {
213221
testExplorer.lspTestDiscovery
214222
.getDocumentTests(folder.swiftPackage, uri)
@@ -219,6 +227,7 @@ export class TestExplorer {
219227
tests,
220228
uri
221229
);
230+
console.log(">>> On Document Symbols 5", document.uri.toString());
222231
testExplorer.onTestItemsDidChangeEmitter.fire(
223232
testExplorer.controller
224233
);

test/integration-tests/testexplorer/TestExplorerIntegration.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ suite("Test Explorer Suite", function () {
8383
requiresDebugger: true,
8484
});
8585

86-
suite("Modifying", function () {
86+
suite.only("Modifying", function () {
8787
let sourceFile: string;
8888
let originalSource: string;
8989

@@ -97,10 +97,6 @@ suite("Test Explorer Suite", function () {
9797
) {
9898
this.skip();
9999
}
100-
101-
// FIXME: Both Linux and Windows aren't triggering the onTestItemsDidChange event
102-
// at the expected time for these tests.
103-
this.skip();
104100
});
105101

106102
beforeEach(() => {
@@ -181,7 +177,7 @@ suite("Test Explorer Suite", function () {
181177
await validate(testItems => !testItems[1].includes(testName));
182178
});
183179

184-
test("Test explorer updates when a suite is added and removed", async () => {
180+
test.skip("Test explorer updates when a suite is added and removed", async () => {
185181
const suiteName = `newSuite${randomString()}`;
186182
const newSuite = `\n@Suite\nstruct ${suiteName} {\n @Test\n func testPassing() throws {\n #expect(1 == 1)\n }\n}\n`;
187183
await Promise.all([

0 commit comments

Comments
 (0)