mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 02:46:15 -05:00
External test runner updates (#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
This commit is contained in:
@@ -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"))) {
|
||||
@@ -63,7 +66,7 @@ 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")];
|
||||
@@ -71,8 +74,8 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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>'.
|
||||
|
||||
|
||||
|
||||
|
||||
8
tests/baselines/reference/user/sift.log
Normal file
8
tests/baselines/reference/user/sift.log
Normal file
@@ -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:
|
||||
@@ -9,6 +9,6 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"chrome-devtools-frontend": "latest"
|
||||
"chrome-devtools-frontend": "1.0.530099"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
import parse5 = require("parse5");
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "parse5-test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"parse5": "latest"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"lib": ["es2015"],
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user