angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Wiki: Continuous Integration Story: "Unknown option" errors

Open ersimont opened this issue 8 years ago • 6 comments

Versions


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

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

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.0
@angular-devkit/build-angular      0.6.0
@angular-devkit/build-ng-packagr   0.6.0
@angular-devkit/build-optimizer    0.6.0
@angular-devkit/core               0.6.0
@angular-devkit/schematics         0.6.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.0
@schematics/angular                0.6.0
@schematics/update                 0.6.0
ng-packagr                         3.0.0-rc.2
rxjs                               6.1.0
typescript                         2.7.2
webpack                            4.6.0

Repro steps

Observed behavior

Instead of running end-to-end tests, it prints this error:

> [email protected] e2e S:\Programming\git repositories\ng-app-state
> ng e2e "--no-progress" "--config=protractor-ci.conf.js"

Unknown option: '--progress'

Desired behavior

It should run the end-to-end tests.

Mention any other details that might be useful (optional)

Removing the --no-progress flag causes it to complain that --config is an unknown option. This is also a problem for the line above it in the file: npm run test -- --single-run --no-progress --browser=ChromeNoSandbox

ersimont avatar May 06 '18 14:05 ersimont

I m getting similar issue with below command

ng test --code-coverage --single-run

Unknown option: '--singleRun'

Tataraovoleti avatar May 07 '18 17:05 Tataraovoleti

Its been documented elsewhere that --single-run is gone, but nothing about e2e dropping support for --no-progress Why are these changes being released without deprecation warnings?

ciarancourtney avatar May 23 '18 09:05 ciarancourtney

Update: after some experimentation, I've come close to making this work. The new equivalent of --config=__ is --protractor-config=___. For the other command, the new equivalent of --single-run is --watch=false. I tried --progress=false in place of --no-progress, but I didn't notice any difference, so I just dropped the flag entirely. Here are my new lines:

script:
  # Use Chromium instead of Chrome.
  - export CHROME_BIN=chromium-browser
  - xvfb-run -a yarn test --code-coverage --watch=false --browsers=ChromeNoSandbox
  - xvfb-run -a yarn e2e --protractor-config=e2e/protractor-ci.conf.js

The last line now works :tada:. However, the line above it still given an error:

Cannot load browser "ChromeNoSandbox": it is not registered!

ersimont avatar May 28 '18 21:05 ersimont

Update: I got it all working. My remaining issue was that I defined ChromeNoSandbox in the wrong karma.conf.js file (I have nested projects). The commands above work for me.

ersimont avatar May 29 '18 23:05 ersimont

What I found is that your can run any command like ng test or ng e2e and add --help and it will print all the available options for v6 and I don't see anything related to progress, this flag has moved inside angular.json file under build-angular:dev-server options.

@ersimont Tip: You don't need xvfb to run Chrome anymore, you can use the headless version like so --browsers=ChromeHeadless and if you also need the no-sandbox flag you can add a customLaunchers inside your karma.conf file, based on ChromeHeadless and add that flag

djhojd avatar Jun 04 '18 09:06 djhojd

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.