Skip to content

Commit 5fcde24

Browse files
authored
External test runner updates (microsoft#21276)
* Increase user test timeout to 10m because npm can be slow, remove parse5 because they added their own types, accept updated error msg for rxjs, acccept current chrome baseline and pin chrmoe version * Suppress lint
1 parent 6d051f8 commit 5fcde24

File tree

8 files changed

+15485
-5382
lines changed

8 files changed

+15485
-5382
lines changed

src/harness/externalCompileRunner.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
3333
});
3434
}
3535
private runTest(directoryName: string) {
36-
describe(directoryName, () => {
36+
// tslint:disable-next-line:no-this-assignment
37+
const cls = this;
38+
const timeout = 600_000; // 10 minutes
39+
describe(directoryName, function(this: Mocha.ISuiteCallbackContext) {
40+
this.timeout(timeout);
3741
const cp = require("child_process");
3842

3943
it("should build successfully", () => {
40-
let cwd = path.join(__dirname, "../../", this.testDir, directoryName);
41-
const timeout = 600000; // 600s = 10 minutes
44+
let cwd = path.join(__dirname, "../../", cls.testDir, directoryName);
4245
const stdio = isWorker ? "pipe" : "inherit";
4346
let types: string[];
4447
if (fs.existsSync(path.join(cwd, "test.json"))) {
@@ -63,16 +66,16 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
6366
if (fs.existsSync(path.join(cwd, "node_modules"))) {
6467
require("del").sync(path.join(cwd, "node_modules"), { force: true });
6568
}
66-
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout, shell: true, stdio });
69+
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout: timeout / 2, shell: true, stdio }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
6770
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);
6871
}
6972
const args = [path.join(__dirname, "tsc.js")];
7073
if (types) {
7174
args.push("--types", types.join(","));
7275
}
7376
args.push("--noEmit");
74-
Harness.Baseline.runBaseline(`${this.kind()}/${directoryName}.log`, () => {
75-
return this.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd);
77+
Harness.Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, () => {
78+
return cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd);
7679
});
7780
});
7881
});

tests/baselines/reference/user/chrome-devtools-frontend.log

Lines changed: 15462 additions & 5350 deletions
Large diffs are not rendered by default.

tests/baselines/reference/user/rxjs.log

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
Exit Code: 1
22
Standard output:
3-
node_modules/rxjs/scheduler/VirtualTimeScheduler.d.ts(22,22): error TS2415: Class 'VirtualAction<T>' incorrectly extends base class 'AsyncAction<T>'.
4-
Types of property 'work' are incompatible.
5-
Type '(this: VirtualAction<T>, state?: T | undefined) => void' is not assignable to type '(this: AsyncAction<T>, state?: T | undefined) => void'.
6-
The 'this' types of each signature are incompatible.
7-
Type 'AsyncAction<T>' is not assignable to type 'VirtualAction<T>'.
8-
Property 'index' is missing in type 'AsyncAction<T>'.
3+
node_modules/rxjs/scheduler/VirtualTimeScheduler.d.ts(24,15): error TS2416: Property 'work' in type 'VirtualAction<T>' is not assignable to the same property in base type 'AsyncAction<T>'.
4+
Type '(this: VirtualAction<T>, state?: T | undefined) => void' is not assignable to type '(this: AsyncAction<T>, state?: T | undefined) => void'.
5+
The 'this' types of each signature are incompatible.
6+
Type 'AsyncAction<T>' is not assignable to type 'VirtualAction<T>'.
7+
Property 'index' is missing in type 'AsyncAction<T>'.
98

109

1110

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Exit Code: 1
2+
Standard output:
3+
node_modules/sift/index.d.ts(22,54): error TS2344: Type 'T[0][index]' does not satisfy the constraint 'any[]'.
4+
node_modules/sift/index.d.ts(32,35): error TS2344: Type 'T[0][P]' does not satisfy the constraint 'any[]'.
5+
6+
7+
8+
Standard error:

tests/cases/user/chrome-devtools-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"author": "",
1010
"license": "Apache-2.0",
1111
"dependencies": {
12-
"chrome-devtools-frontend": "latest"
12+
"chrome-devtools-frontend": "1.0.530099"
1313
}
1414
}

tests/cases/user/parse5/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/cases/user/parse5/package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/cases/user/parse5/tsconfig.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)