Skip to content

ng e2e and ng test should behave equally as default (watch mode) #12932

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

Closed
DanielHabenicht opened this issue Nov 11, 2018 · 4 comments
Closed
Labels
area: @angular-devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity1: confusing
Milestone

Comments

@DanielHabenicht
Copy link

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

Versions

Output from: node --version, npm --version and ng --version: Windows 10

node --version
v10.4.1
npm --version
6.4.1
 ng --version

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


Angular CLI: 7.0.2
Node: 10.4.1
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.10.2
@angular-devkit/core         7.0.2
@angular-devkit/schematics   7.0.2
@schematics/angular          7.0.2
@schematics/update           0.10.2
rxjs                         6.3.3
typescript                   3.1.3

Repro steps

  1. ng new project-to-reproduce
  2. The default behaviour of ng test and ng e2e are as following:
    ng test: Executed in watch mode. Command does not exit, has to be cancelled.
    ng e2e: Executed once. Command exits after tests are finished.

Desired functionality

Both commands should behave the same. This means either both should run in watch mode or both should execute once as default. Having a different behaviour on each of them is confusing.

In my opinion both should run only once and exit cleanly, as this does allow easier configuration of CI (without any changing of the config files or appending an option like --singleRun true) and does ensure that calling a command without any options does not get an automated script stuck.

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity1: confusing area: @angular-devkit/build-angular labels Nov 11, 2018
@ngbot ngbot bot added this to the needsTriage milestone Nov 11, 2018
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Nov 11, 2018

Hi, just as a side note ng test can run without watch mode by default it honours the karma configuration set in
https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/application/files/root/karma.conf.js

@DanielHabenicht
Copy link
Author

Hi, thanks for fast the reply. I know about it.
It's just that I have been creating some new angular apps recently and this is something I stumbled upon, because I always forgot to reconfigure the karma.conf.js, so my first build always crashed (resp. never finished).

Just wanted to let you know. Keep up the good work. :)

@filipesilva
Copy link
Contributor

Having ng test only run once is something we have considered, and tried, in the past. It did not go well. ng test has been watch mode by default since the start and existing users found it confusing that the behaviour changed. So we kept the behaviour.

Using it in automated scripts, like CI, is documented in https://github.com/angular/angular-cli/wiki/stories-continuous-integration. You can force watching to be false via ng test --watch=false.

Having ng e2e run in watch mode is something I don't feel makes much sense. It will always be very, very slow. But there is an issue in #2861 for it already.

@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
area: @angular-devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity1: confusing
Projects
None yet
Development

No branches or pull requests

3 participants