Skip to content

Commit

Permalink
Fix: increase test timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
ishche committed Apr 13, 2023
1 parent d6ba9c6 commit 44f09a5
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import * as vscode from "vscode";
import { getWorkspacePath, moveCursor, recursiveCopySync } from "./testHelper";
import * as path from "path";

const TEST_TIMEOUT = 30000;

suite("Integration Test Suite", () => {
const workspace_file = "USER1.cbl";
let editor: vscode.TextEditor;

suiteSetup(async function () {
this.timeout(30000);
this.timeout(TEST_TIMEOUT);
await helper.showDocument(workspace_file);
helper.updateConfig("basic.json");
editor = helper.get_editor(workspace_file);
Expand All @@ -36,7 +38,7 @@ suite("Integration Test Suite", () => {
await helper.sleep(1000);
assert.ok(editor.document.languageId === "cobol");
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC152046 Nominal - check syntax Ok message", async () => {
Expand All @@ -49,7 +51,7 @@ suite("Integration Test Suite", () => {
"Checks that when opening Cobol file with correct syntax there is an appropriate message is shown",
);
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC152049 Navigate through definitions", async () => {
Expand All @@ -69,7 +71,7 @@ suite("Integration Test Suite", () => {
);
});
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC152080 Find all references from the word middle", async () => {
Expand All @@ -90,7 +92,7 @@ suite("Integration Test Suite", () => {
);
});
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC152080 Find all references from the word begin", async () => {
Expand All @@ -111,7 +113,7 @@ suite("Integration Test Suite", () => {
);
});
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test('TC152047/ TC152052/ TC152051/ TC152050/ TC152053 Error case - file has syntax errors and are marked with detailed hints', async () => {
Expand All @@ -130,7 +132,7 @@ suite("Integration Test Suite", () => {
assert.strictEqual(diagnostics[1].message, "Syntax error on 'HELLO-WORLD' expected {AUTHOR, CBL, DATA, DATE-COMPILED, DATE-WRITTEN, END, ENVIRONMENT, ID, IDENTIFICATION, INSTALLATION, PROCEDURE, PROCESS, SECURITY}");
helper.assertRangeIsEqual(diagnostics[1].range, new vscode.Range(new vscode.Position(14, 20), new vscode.Position(14, 31)));

}).timeout(5000).slow(1000);
}).timeout(TEST_TIMEOUT).slow(1000);

test('TC152050/ TC152053 Error case - file has semantic errors and are marked with detailed hints', async () => {
await helper.showDocument("REPLACING.CBL");
Expand All @@ -144,7 +146,7 @@ suite("Integration Test Suite", () => {
assert.strictEqual(diagnostics[0].message, "Variable ABC-ID is not defined");
helper.assertRangeIsEqual(diagnostics[0].range, new vscode.Range(new vscode.Position(21, 21), new vscode.Position(21, 27)));

}).timeout(5000).slow(1000);
}).timeout(TEST_TIMEOUT).slow(1000);

test("TC152054 Auto format of right trailing spaces", async () => {
await helper.insertString(editor, new vscode.Position(34, 57), " ");
Expand All @@ -165,7 +167,7 @@ suite("Integration Test Suite", () => {
assert.strictEqual(result[0].newText, "");
});
})
.timeout(3000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC288736 error message for 80chars limit", async () => {
Expand Down Expand Up @@ -194,7 +196,7 @@ suite("Integration Test Suite", () => {
}
assert.fail();
})
.timeout(4000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174655 Copybook - Nominal", async () => {
Expand All @@ -208,7 +210,7 @@ suite("Integration Test Suite", () => {
"No syntax errors detected in USERC1N1.cbl",
);
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174657: Copybook - not exist: no syntax ok message", async () => {
Expand All @@ -222,7 +224,7 @@ suite("Integration Test Suite", () => {
"No syntax errors detected in USERC1F.cbl",
);
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174658/TC174658 Copybook - not exist: error underlying and detailed hint", async () => {
Expand All @@ -240,7 +242,7 @@ suite("Integration Test Suite", () => {
);
assert.strictEqual(diagnostics[0].message, "BOOK3: Copybook not found");
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174916/TC174917 Copybook - recursive error and detailed hint", async () => {
Expand All @@ -258,7 +260,7 @@ suite("Integration Test Suite", () => {
"Recursive copybook declaration for: BOOK1R",
);
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174932/TC174933 Copybook - invalid definition and hint", async () => {
Expand All @@ -279,7 +281,7 @@ suite("Integration Test Suite", () => {
"Variable USER-PHONE-MOBILE1 is not defined",
);
})
.timeout(2000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC312735 Check EXEC CICS is in Procedure Division", async () => {
Expand Down Expand Up @@ -309,7 +311,7 @@ suite("Integration Test Suite", () => {
"Missing token SQL at execSqlStatement",
);
})
.timeout(8000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC266094 Underline the entire incorrect variable structure", async () => {
Expand Down Expand Up @@ -342,7 +344,7 @@ suite("Integration Test Suite", () => {
"Variable CHILD2 is not defined",
);
})
.timeout(7000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174952 Copybook - not exist, but dynamically appears", async () => {
Expand Down Expand Up @@ -375,7 +377,7 @@ suite("Integration Test Suite", () => {
"Variable CHILD2 is not defined",
);
})
.timeout(7000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("Load resource file', () => {\n", async () => {
Expand All @@ -393,7 +395,7 @@ suite("Integration Test Suite", () => {
new vscode.Range(new vscode.Position(5, 7), new vscode.Position(5, 20)),
);
})
.timeout(3000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC174952 / TC174953 Copybook - definition not exist, but dynamically appears", async () => {
Expand Down Expand Up @@ -433,7 +435,7 @@ suite("Integration Test Suite", () => {
);
}
})
.timeout(10000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("'TC266074 LSP analysis for extended sources - basic scenario", async () => {
Expand Down Expand Up @@ -512,7 +514,7 @@ suite("Integration Test Suite", () => {
);
await helper.closeAllEditors();
})
.timeout(15000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC250107 Test Area A, check DIVISION and paragraph name warnings", async () => {
Expand Down Expand Up @@ -555,7 +557,7 @@ suite("Integration Test Suite", () => {
);
await helper.closeAllEditors();
})
.timeout(16000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC250107 Test Area A, Check FD/SD level data", async () => {
Expand All @@ -580,7 +582,7 @@ suite("Integration Test Suite", () => {
);
await helper.closeAllEditors();
})
.timeout(3000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC250109 Test Area B", async () => {
Expand Down Expand Up @@ -621,7 +623,7 @@ suite("Integration Test Suite", () => {
);
await helper.closeAllEditors();
})
.timeout(5000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC250108 Test Program Name", async () => {
Expand All @@ -645,7 +647,7 @@ suite("Integration Test Suite", () => {
);
await helper.closeAllEditors();
})
.timeout(3000)
.timeout(TEST_TIMEOUT)
.slow(1000);

test("TC247497 - Local Copybooks - check hidden folders under c4z", async () => {
Expand All @@ -654,6 +656,6 @@ suite("Integration Test Suite", () => {
const hiddenFolder = vscode.workspace.getWorkspaceFolder(extSrcUri);
assert.ok(hiddenFolder !== undefined);
})
.timeout(1000)
.timeout(TEST_TIMEOUT)
.slow(1000);
});

0 comments on commit 44f09a5

Please sign in to comment.