Repository navigation
Description
🐞 Bug report
Command (mark with an x)
ng test --code-coverage
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Is this a regression?
Yes. @angular-devkit/build-angular 14.0.2 works as expected.
Description
An error is thrown when running tests.
🔬 Minimal Reproduction
Just run test with code coverage
🔥 Exception or Error
⠋ Generating browser application bundles (phase: setup)...An unhandled exception occurred: EACCES: permission denied, scandir '/boot/efi'
And the angular log contain :
[error] Error: EACCES: permission denied, scandir '/boot/efi'
at Object.readdirSync (node:fs:1405:3)
at GlobSync._readdir (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:288:46)
at GlobSync._readdirInGlobStar (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:267:20)
at GlobSync._readdir (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:276:17)
at GlobSync._processReaddir (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:137:22)
at GlobSync._process (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:132:10)
at GlobSync._processGlobStar (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:380:10)
at GlobSync._process (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:130:10)
at GlobSync._processGlobStar (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:383:10)
at GlobSync._process (/home/damob/projects/pm2/frontend/node_modules/@angular-devkit/build-angular/node_modules/glob/sync.js:130:10)
🌍 Your Environment
Angular CLI: 14.0.3
Node: 16.15.0
Package Manager: yarn 3.2.1
OS: linux x64
Angular: 14.0.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, material-moment-adapter, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1400.3
@angular-devkit/build-angular 14.0.3
@angular-devkit/core 14.0.3
@angular-devkit/schematics 14.0.3
@angular/flex-layout 13.0.0-beta.38
@schematics/angular 14.0.3
ng-packagr 14.0.2
rxjs 7.5.5
typescript 4.7.4
Activity
alan-agius4 commentedon Jun 29, 2022
Can you share the test section of your
angular.json?christiangoudreau commentedon Jun 29, 2022
Sure. That being said, tests runs correctly without --code-coverage
"test": { "configurations": { "ci": { "karmaConfig": "projects/investors/karma.conf.ci.js" } }, "builder": "@angular-devkit/build-angular:karma", "options": { "main": "projects/investors/src/test.ts", "polyfills": "projects/investors/src/polyfills.ts", "tsConfig": "projects/investors/tsconfig.spec.json", "karmaConfig": "projects/investors/karma.conf.js", "codeCoverageExclude": [ "/**/*.module.ts", "/**/providers.ts" ] } },alan-agius4 commentedon Jun 29, 2022
In general we don’t expect paths to start with a forward slash.
As a workaround you could remove the leading
/from thecodeCoverageExcludepaths.We should disallow mounting of globs starting with forward slash.
christiangoudreau commentedon Jun 29, 2022
You think it's only that ? I'll try
alan-agius4 commentedon Jun 30, 2022
Yes
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
fix(@angular-devkit/build-angular): disable glob mounting for pattern…
christiangoudreau commentedon Jun 30, 2022
I does fix the problem, thank you really much!
fix: codeCoverageExclude glob issue
angular-automatic-lock-bot commentedon Jul 31, 2022
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.