Skip to content

ng test much slower than ng build/serve #5334

Closed
@tmansson

Description

@tmansson

OS?

Linux (Ubuntu 16.04)

Versions.

@angular/cli: 1.0.0-rc.1
node: 6.10.0
os: linux x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

Repro steps.

ng test is much slower than ng build and ng serve on both first build (60s vs 20s), and on retriggered builds (20s vs 1s).

It's spending alot of time on chunk asset optimization, so this looks like the previous problems with build performance discussed in #1980. Is it the same problem, and the fix for build and serve hasn't been implemented in test yet?

Also ng test seems to build the entire app-folder even though my tests are confined to pure functions in spec-files. This seems to go against what's defined in test.js, where only spec.ts-files are gathered. I've tried running ng test --build false, but it doesn't make a difference.

Mention any other details that might be useful.

If I run ng test --sourcemap false I get comparable performance, but this is puzzling to since build/serve runs with sourcemaps enabled...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions