Skip to content

External test runner updates #21276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/harness/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
});
}
private runTest(directoryName: string) {
describe(directoryName, () => {
// tslint:disable-next-line:no-this-assignment
const cls = this;
const timeout = 600_000; // 10 minutes
describe(directoryName, function(this: Mocha.ISuiteCallbackContext) {
this.timeout(timeout);
const cp = require("child_process");

it("should build successfully", () => {
let cwd = path.join(__dirname, "../../", this.testDir, directoryName);
const timeout = 600000; // 600s = 10 minutes
let cwd = path.join(__dirname, "../../", cls.testDir, directoryName);
const stdio = isWorker ? "pipe" : "inherit";
let types: string[];
if (fs.existsSync(path.join(cwd, "test.json"))) {
Expand All @@ -63,16 +66,16 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
if (fs.existsSync(path.join(cwd, "node_modules"))) {
require("del").sync(path.join(cwd, "node_modules"), { force: true });
}
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout, shell: true, stdio });
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
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);
}
const args = [path.join(__dirname, "tsc.js")];
if (types) {
args.push("--types", types.join(","));
}
args.push("--noEmit");
Harness.Baseline.runBaseline(`${this.kind()}/${directoryName}.log`, () => {
return this.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd);
Harness.Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, () => {
return cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd);
});
});
});
Expand Down
20,812 changes: 15,462 additions & 5,350 deletions tests/baselines/reference/user/chrome-devtools-frontend.log

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions tests/baselines/reference/user/rxjs.log
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Exit Code: 1
Standard output:
node_modules/rxjs/scheduler/VirtualTimeScheduler.d.ts(22,22): error TS2415: Class 'VirtualAction<T>' incorrectly extends base class 'AsyncAction<T>'.
Types of property 'work' are incompatible.
Type '(this: VirtualAction<T>, state?: T | undefined) => void' is not assignable to type '(this: AsyncAction<T>, state?: T | undefined) => void'.
The 'this' types of each signature are incompatible.
Type 'AsyncAction<T>' is not assignable to type 'VirtualAction<T>'.
Property 'index' is missing in type 'AsyncAction<T>'.
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>'.
Type '(this: VirtualAction<T>, state?: T | undefined) => void' is not assignable to type '(this: AsyncAction<T>, state?: T | undefined) => void'.
The 'this' types of each signature are incompatible.
Type 'AsyncAction<T>' is not assignable to type 'VirtualAction<T>'.
Property 'index' is missing in type 'AsyncAction<T>'.



Expand Down
8 changes: 8 additions & 0 deletions tests/baselines/reference/user/sift.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Exit Code: 1
Standard output:
node_modules/sift/index.d.ts(22,54): error TS2344: Type 'T[0][index]' does not satisfy the constraint 'any[]'.
node_modules/sift/index.d.ts(32,35): error TS2344: Type 'T[0][P]' does not satisfy the constraint 'any[]'.



Standard error:
2 changes: 1 addition & 1 deletion tests/cases/user/chrome-devtools-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"chrome-devtools-frontend": "latest"
"chrome-devtools-frontend": "1.0.530099"
}
}
1 change: 0 additions & 1 deletion tests/cases/user/parse5/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions tests/cases/user/parse5/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/cases/user/parse5/tsconfig.json

This file was deleted.