Skip to content
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

test --code-coverage fails for app project referencing library project on Windows #11934

Closed
mrosack opened this issue Aug 17, 2018 · 3 comments · Fixed by #11974
Closed

test --code-coverage fails for app project referencing library project on Windows #11934

mrosack opened this issue Aug 17, 2018 · 3 comments · Fixed by #11974
Labels
Milestone

Comments

@mrosack
Copy link

mrosack commented Aug 17, 2018

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [X] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Windows 10
node --version: v8.11.3
npm --version: 5.6.0

Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular: 6.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.8
@angular-devkit/build-angular      0.6.8
@angular-devkit/build-ng-packagr   0.6.8
@angular-devkit/build-optimizer    0.6.8
@angular-devkit/core               0.6.8
@angular-devkit/schematics         0.6.8
@angular/cli                       6.0.8
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.8
@schematics/angular                0.6.8
@schematics/update                 0.6.8
ng-packagr                         3.0.6
rxjs                               6.2.2
typescript                         2.7.2
webpack                            4.8.3

Repro steps

The log given by the failure

17 08 2018 10:35:28.972:ERROR [karma]: RangeError: Maximum call stack size exceeded
    at normalizeStringWin32 (path.js:33:30)
    at Object.resolve (path.js:328:20)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:68:14)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:77:24)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)

Desired functionality

Code coverage report should be successfully generated

Mention any other details that might be useful

This seems to work fine in linux, I'm assuming this is a windows-only issue.

@james-schwartzkopf
Copy link

james-schwartzkopf commented Aug 17, 2018

We fixed this in our project by adding our library dist folder to:
angular.json/projects/${our_project}/architect/test/options/codeCoverageExcludes using a glob ("dist/${our_lib}/**/*").

We didn't want our library files showing up in the report anyway, they have their own test & coverage.

Would be nice to have a solution built in.

@mrosack
Copy link
Author

mrosack commented Aug 17, 2018

worked for me, thanks @james-schwartzkopf!

@ngbot ngbot bot added this to the needsTriage milestone Aug 20, 2018
@filipesilva filipesilva added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient labels Aug 24, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Aug 24, 2018
vikerman pushed a commit that referenced this issue Aug 28, 2018
…under `sourceRoot` (#11974)

In some cases when having libraries within the workspace this is causing a `Maximum call stack size exceeded`, Also for libraries coverage should be collected with the respective `ng test`

Closes #11934
vikerman pushed a commit that referenced this issue Aug 29, 2018
…under `sourceRoot` (#11974)

In some cases when having libraries within the workspace this is causing a `Maximum call stack size exceeded`, Also for libraries coverage should be collected with the respective `ng test`

Closes #11934
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants