Speed up Travis by running Webpack in fewer tests (#381)

* Reorganize Travis configuration

* Add a `JOB` env var descriptor to all matrix entries. Not used anywhere but is
  useful when viewing the whole build on Travis's web interface.
* Reorganize where builds are located, moving slow builds first and fast ones
  last.
* Change checking the CLI builds from `cargo build` to `cargo check`
* Use YAML references to reduce some duplication

* Print some more timing statistics for each test

* Extract `Project` helper in tests to a module

This'll help make it a bit more extensible over time. At the same time the
methods are also slightly reorganized to read more clearly from top to bottom.

* Migrate all tests away from Webpack

Wepback can take a significant amount of time to execute and when it's
multiplied by hundreds of tests that adds up really quickly! After investigating
Node's `--experimental-modules` option it looks like it's suitable for our use
so this switches all tests to using JS files (moving away from TypeScript as
well) with `--experimental-modules` with Node.

Tests will be selectively re-enabled with webpack and node.js specific output
(that doesn't require `--experimental-modules`), coming in later commits.

* Restore the node test for node.js output

Ensures it's workable as-is

* Only generate typescript with webpack

* Only read wasm files for webpack

* Skip package.json/node_modules for now

* Only generate webpack config if needed

* Start a dedicated test module for typescript

Will hopefully verify the generated Typescript compiles OK.

* Remove unneeded `node` method

* Fixup some rebase conflicts

* Don't run asmjs example on travis

* Fixup generator tests

* Attempt to fix windows

* Comment windows fix

* More test fixes

* More exclusions

* More test fixes

* Relax eslint regex

Catch mjs modules as well

* Fix eslint

* Speed up travis on examples slightly
This commit is contained in:
Alex Crichton
2018-07-04 22:37:09 -05:00
committed by GitHub
parent e912b9d2a2
commit efa4a2b8fa
45 changed files with 3944 additions and 3513 deletions

View File

@@ -22,7 +22,7 @@ fn length() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -58,7 +58,7 @@ fn char_at() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -93,7 +93,7 @@ fn char_code_at() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -128,7 +128,7 @@ fn code_point_at() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -162,7 +162,7 @@ fn concat() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -196,7 +196,7 @@ fn includes() {
this.includes(search_value, position)
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -231,7 +231,7 @@ fn index_of() {
this.index_of(search_value, from_index)
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -274,7 +274,7 @@ fn slice() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -305,7 +305,7 @@ fn starts_with() {
this.starts_with(search_string, position)
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -336,7 +336,7 @@ fn substring() {
this.substring(index_start, index_end)
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -375,7 +375,7 @@ fn substr() {
this.substr(start, length)
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -411,7 +411,7 @@ fn to_lower_case() {
this.to_lower_case()
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -441,7 +441,7 @@ fn to_string() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -470,7 +470,7 @@ fn to_upper_case() {
this.to_upper_case()
}
"#)
.file("test.ts", r#"
.file("test.js", r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -500,7 +500,7 @@ fn trim() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -539,7 +539,7 @@ fn trim_end_and_trim_right() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -579,7 +579,7 @@ fn trim_start_and_trim_left() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";
@@ -614,7 +614,7 @@ fn value_of() {
"#,
)
.file(
"test.ts",
"test.js",
r#"
import * as assert from "assert";
import * as wasm from "./out";