Skip to content

Commit f71e6ea

Browse files
committed
test: fix Windows CI for model resolution
Signed-off-by: younes-io <git@younes.io>
1 parent f0fbfd6 commit f71e6ea

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

tests/suite/commands/modelResolver.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ suite('Model Resolver', () => {
3535

3636
const result = await resolveModelForUri(vscode.Uri.file(tlaPath), true, false);
3737
assert.ok(result, 'Expected resolved model');
38-
assert.strictEqual(result?.tlaPath, tlaPath);
39-
assert.strictEqual(result?.cfgPath, cfgPath);
38+
assert.strictEqual(result?.tlaPath, vscode.Uri.file(tlaPath).fsPath);
39+
assert.strictEqual(result?.cfgPath, vscode.Uri.file(cfgPath).fsPath);
4040
assert.strictEqual(result?.modelName, 'Spec');
4141
});
4242

@@ -50,8 +50,8 @@ suite('Model Resolver', () => {
5050

5151
const result = await resolveModelForUri(vscode.Uri.file(tlaPath), true, false);
5252
assert.ok(result, 'Expected resolved model');
53-
assert.strictEqual(result?.tlaPath, mcTlaPath);
54-
assert.strictEqual(result?.cfgPath, mcCfgPath);
53+
assert.strictEqual(result?.tlaPath, vscode.Uri.file(mcTlaPath).fsPath);
54+
assert.strictEqual(result?.cfgPath, vscode.Uri.file(mcCfgPath).fsPath);
5555
assert.strictEqual(result?.modelName, 'MCSpec');
5656
});
5757

@@ -71,7 +71,7 @@ suite('Model Resolver', () => {
7171

7272
const result = await resolveModelForUri(vscode.Uri.file(tlaPath), true, true);
7373
assert.ok(result, 'Expected resolved model');
74-
assert.strictEqual(result?.cfgPath, mcCfgPath);
74+
assert.strictEqual(result?.cfgPath, vscode.Uri.file(mcCfgPath).fsPath);
7575
});
7676

7777
test('Non-interactive selection prefers Spec.cfg when multiple exist', async () => {
@@ -86,7 +86,7 @@ suite('Model Resolver', () => {
8686

8787
const result = await resolveModelForUri(vscode.Uri.file(tlaPath), true, false);
8888
assert.ok(result, 'Expected resolved model');
89-
assert.strictEqual(result?.cfgPath, cfgPath);
89+
assert.strictEqual(result?.cfgPath, vscode.Uri.file(cfgPath).fsPath);
9090
});
9191

9292
test('Returns undefined when cfg has no matching tla', async () => {
@@ -117,8 +117,8 @@ suite('Model Resolver', () => {
117117

118118
const result = await resolveModelForUri(vscode.Uri.file(tlaPath), true, true, 'customPick');
119119
assert.ok(result, 'Expected resolved model');
120-
assert.strictEqual(result?.tlaPath, tlaPath);
121-
assert.strictEqual(result?.cfgPath, altTlaPath);
120+
assert.strictEqual(result?.tlaPath, vscode.Uri.file(tlaPath).fsPath);
121+
assert.strictEqual(result?.cfgPath, vscode.Uri.file(altTlaPath).fsPath);
122122
assert.strictEqual(result?.modelName, 'Alt');
123123
assert.strictEqual(result?.outputDir, testDir);
124124
});

tests/suite/commands/parseModule.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ suite('Parse Module Stream Merging Tests', () => {
2222
});
2323

2424
test('ToolProcessInfo merges stdout and stderr streams with syntax errors', async function() {
25-
this.timeout(10000);
25+
const isWin = process.platform === 'win32';
26+
this.timeout(isWin ? 60000 : 10000);
2627

2728
// This test verifies that our stream merging implementation works correctly
2829
// by checking that SANY error messages are captured in the mergedOutput stream
@@ -65,7 +66,10 @@ Spec == Init /\\ Next
6566
resolve();
6667
return;
6768
}
68-
const timer = setTimeout(() => reject(new Error('mergedOutput did not end in time')), 5000);
69+
const timer = setTimeout(
70+
() => reject(new Error('mergedOutput did not end in time')),
71+
isWin ? 30000 : 5000
72+
);
6973
procInfo.mergedOutput.once('end', () => {
7074
clearTimeout(timer);
7175
resolve();

0 commit comments

Comments
 (0)