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

Running ng test throws error for different builders with no overrides #12344

Closed
FrozenPandaz opened this issue Sep 21, 2018 · 3 comments
Closed

Comments

@FrozenPandaz
Copy link
Contributor

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
- [x] build
- [ ] serve
- [x] test
- [x] e2e
- [ ] generate
- [ ] add
- [ ] update
- [x] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Jasons-MacBook-Pro:oldnxws jason$ ng -v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.2.3
Node: 8.10.0
OS: darwin x64
Angular: 6.1.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.3
@angular-devkit/build-angular     0.8.3
@angular-devkit/build-optimizer   0.8.3
@angular-devkit/build-webpack     0.8.3
@angular-devkit/core              0.8.3
@angular-devkit/schematics        0.8.3
@angular/cli                      6.2.3
@ngtools/webpack                  6.2.3
@schematics/angular               0.8.3
@schematics/update                0.8.3
rxjs                              6.3.2
typescript                        2.9.2
webpack                           4.19.1

Repro steps

A workspace with projects with different builders will not be able to use ng test (no overrides).

The log given by the failure

The following Error is thrown:

Jasons-MacBook-Pro:oldnxws jason$ yarn test
yarn run v1.9.4
$ ng test
Architect commands with command line overrides cannot target different builders. The 'test' target would run on projectsapp1,app2 which have the following builders:  @angular-devkit/build-angular:karma @nrwl/builders:jest
Error: Architect commands with command line overrides cannot target different builders. The 'test' target would run on projects app1,app2 which have the following builders:  @angular-devkit/build-angular:karma @nrwl/builders:jest
    at TestCommand.validate (/Users/jason/projects/temp/oldnxws/node_modules/@angular/cli/models/architect-command.js:95:27)
    at Object.<anonymous> (/Users/jason/projects/temp/oldnxws/node_modules/@angular/cli/models/command-runner.js:175:39)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/jason/projects/temp/oldnxws/node_modules/@angular/cli/models/command-runner.js:11:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

Desired functionality

I understand that with different builders, sending overrides to all of them will be virtually impossible to manage. However, without overrides should not be an error (ng test with no overrides) since the configuration within angular.json will be specific to the builder for each target.

Mention any other details that might be useful

This would be extremely useful for something I'm working on for Nx which is to build backends inside an angular cli workspace. If ng test (no overrides) were to test all projects regardless of which builder they were using, just that they have a test target.

Also might be useful

Also, if there could be a flag that allows overrides to be sent, it could enable some usage if two builders were to share similar options.

@FrozenPandaz
Copy link
Contributor Author

cc @clydin

@hansl
Copy link
Contributor

hansl commented Sep 27, 2018

This is solved on master with our new parsing code. I'm submitting a fix for the patch branch.

hansl added a commit to hansl/angular-cli that referenced this issue Sep 27, 2018
Configuration for yargs made it so the return value is different
now and triggers our logic to have extra overrides.

Fixes angular#12344.
vikerman pushed a commit that referenced this issue Sep 27, 2018
Configuration for yargs made it so the return value is different
now and triggers our logic to have extra overrides.

Fixes #12344.
@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.
Projects
None yet
Development

No branches or pull requests

5 participants