Angular-cli: Automatically disable progress indicators in CI environments

Created on 4 Mar 2017  路  3Comments  路  Source: angular/angular-cli

It might be nice to automatically suppress progress output when running in a CI environment, like AppVeyor or Travis CI. Sure, one can set --progress=false or similar, but if that automatically happened when a CI environment variable is set that could improve the out-of-the-box CI experience.

With AppVeyor particularly, I've noticed build output having some stuff to scroll through.

Most helpful comment

Would it be possible to reconsider the CI environment variable. Let me explain why.

I recently had to add automatic testing of our Angular CLI application to our Jenkins build server. I had to do some tricky stuff in order for it to work with a headless browser etc, a lot of people will know the pain. That's why I started a small project called korn which I hope will take this pain away. It uses a Docker container under the hood and runs your tests headlessly.

By default, running the npm test command will start the tests in watch mode. This off course doesn't really make sense in a CI environment because you only want to run them once. This is possible with the --single-run flag.

Korn does not target Angular in particular, React or other front-end frameworks should work as well. That's why I don't want to add tool specific flags. I also tested it with create-react-app and noticed in the docs that they use the single-run mode when CI is set.

Maybe we should see the CI (or another env variable) as a set of defaults that are automatically applied without having to do anything else.

  • CI=true npm test
  • npm test --single-run --progress=false (maybe some others)

I don't know, just wanted to give my 2 cents and my use case.

All 3 comments

Variables set by CI environments vary from one to another. Unfortunately, it would be hard to track.

You'll have to use --progress=false. We could consider adding a silent mode or supporting a default value which would cover your use case pretty neatly. Unfortunately, this is not planned for 1.0, so I'll close this issue.

Would it be possible to reconsider the CI environment variable. Let me explain why.

I recently had to add automatic testing of our Angular CLI application to our Jenkins build server. I had to do some tricky stuff in order for it to work with a headless browser etc, a lot of people will know the pain. That's why I started a small project called korn which I hope will take this pain away. It uses a Docker container under the hood and runs your tests headlessly.

By default, running the npm test command will start the tests in watch mode. This off course doesn't really make sense in a CI environment because you only want to run them once. This is possible with the --single-run flag.

Korn does not target Angular in particular, React or other front-end frameworks should work as well. That's why I don't want to add tool specific flags. I also tested it with create-react-app and noticed in the docs that they use the single-run mode when CI is set.

Maybe we should see the CI (or another env variable) as a set of defaults that are automatically applied without having to do anything else.

  • CI=true npm test
  • npm test --single-run --progress=false (maybe some others)

I don't know, just wanted to give my 2 cents and my use case.

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._

Was this page helpful?
0 / 5 - 0 ratings