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

ng test does not run tests for all projects #21473

Open
1 of 15 tasks
swseverance opened this issue Jul 30, 2021 · 7 comments
Open
1 of 15 tasks

ng test does not run tests for all projects #21473

swseverance opened this issue Jul 30, 2021 · 7 comments
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@swseverance
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Don't know

Description

The ng test documentation states "When a project name is not supplied, it will execute for all projects". However, this does not appear to be true. Only the tests for a single project are run.

image

🔬 Minimal Reproduction

  1. Clone https://github.com/swseverance/my-workspace
  2. npm install
  3. Run ng test and observe how only the tests for the app are run. The tests for the lib are not run.

OR

  1. Create a workspace
  2. Create an app within the workspace
  3. Create a lib within the workspace
  4. Run ng test and observe how only the tests for the app are run. The tests for the lib are not run.

🔥 Exception or Error

N/A

🌍 Your Environment


Angular CLI: 11.2.14
Node: 14.17.0
OS: darwin x64

Angular: 11.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.14
@angular-devkit/build-angular   0.1102.14
@angular-devkit/core            11.2.14
@angular-devkit/schematics      11.2.14
@schematics/angular             11.2.14
@schematics/update              0.1102.14
ng-packagr                      11.2.4
rxjs                            6.6.7
typescript                      4.1.6

Anything else relevant?

@alan-agius4 alan-agius4 added area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix labels Jul 30, 2021
@ngbot ngbot bot modified the milestone: Backlog Jul 30, 2021
@alan-agius4 alan-agius4 added area: docs Related to the documentation and removed severity5: regression type: bug/fix labels Jul 30, 2021
@alan-agius4
Copy link
Collaborator

I think we should clarify the docs, that this only happens when test are not run in watch mode (Which is true by default).

@TrevorKarjanis
Copy link
Contributor

The newly generated repository for #21619 reproduces this as well, but our upgraded v12 application does not.

@alan-agius4
Copy link
Collaborator

Interesting so something else might be going on

@alan-agius4 alan-agius4 added severity5: regression type: bug/fix and removed area: docs Related to the documentation labels Aug 21, 2021
@TrevorKarjanis
Copy link
Contributor

The newly generated repository for #21619 reproduces this as well, but our upgraded v12 application does not.

I stand to correct myself. The test command runs only the default project tests when a project is not provided and watch true by default. All tests are run when no project is provided and watch is false which we found useful for CI. Sorry for the confusion.

@Lonli-Lokli
Copy link

So what is the solution to run all tests in monorepo?

@BePo65
Copy link

BePo65 commented Jan 14, 2023

According to pr #21478 the documentation should clarify that all projects are only tested, when --watch=false. Will the content of that pr also be included in the angular docs or is this a different repository?

Anyway: angular.io does not yet show the modified documentation.

@MattiJarvinen
Copy link

According to pr #21478 the documentation should clarify that all projects are only tested, when --watch=false. Will the content of that pr also be included in the angular docs or is this a different repository?

Anyway: angular.io does not yet show the modified documentation.

In #21478 it was decided it's not a purely documentation issue.

#26850 contains reproduction instructions with Angular 17 cli.

I wonder if the fix effort is tied with web-test-runner, since @dgp1130 wrote Moving Angular CLI to Jest and Web Test Runner, would you happen to know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: angular/cli freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants