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

Code Coverage Doesn't print to log #3602

Closed
georgeedwards opened this issue Dec 16, 2016 · 6 comments · Fixed by #12542
Closed

Code Coverage Doesn't print to log #3602

georgeedwards opened this issue Dec 16, 2016 · 6 comments · Fixed by #12542
Labels
area: devkit/build-angular feature Issue that requests a new feature

Comments

@georgeedwards
Copy link

OS?

Windows 10

Versions.

>ng --version
angular-cli: 1.0.0-beta.21
node: 6.9.2
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
No, cli generated project - although not sure it would matter?

The log given by the failure.

Normally this include a stack trace and some more information.

>ng test --code-coverage -sr
16 12 2016 17:01:19.300:INFO [karma]: Karma v1.3.0 server started at http://localhost:9876/
16 12 2016 17:01:19.305:INFO [launcher]: Launching browser Chrome with unlimited concurrency
16 12 2016 17:01:19.326:INFO [launcher]: Starting browser Chrome
16 12 2016 17:01:31.883:INFO [Chrome 54.0.2840 (Windows 10 0.0.0)]: Connected on socket /#bBs3C5TU2REBI4NoAAAA with id 75263073
Chrome 54.0.2840 (Windows 10 0.0.0): Executed 23 of 23 SUCCESS (4.471 secs / 4.363 secs)
16 12 2016 17:01:41.478:WARN [launcher]: Chrome was not killed in 2000 ms, sending SIGKILL.

Mention any other details that might be useful.

There isn't any Code Coverage info printed in the log? Although a coverage dir is created in the project root.


Thanks! We'll be in touch soon.

@georgeedwards georgeedwards changed the title Code Coverage Doesn't work Code Coverage Doesn't print to log Dec 16, 2016
@lordmat0
Copy link

You would need to add this to the Karma configuration file yourself. I don't think this should be a standard thing that's forced on everyone.

@mattdistefano
Copy link

Would be nice to see it as an optional command line flag.

@georgeedwards
Copy link
Author

Yes I agree:

  1. I don't think having a cli flag that doesn't modify the log output at all is very intuitive
  2. For a wide range of use cases (e.g. CI) build files may not be convenient to access, where as logs are.

This seems to be a pretty integral part of code coverage reporting and is something I definitely feel should be an option in this cli.

@JT-Bruch
Copy link

I also attempted to modify my karma-conf to make it error out and it did not work because the CLI does not pass the proper configs down.

See this issue.
#3435

@filipesilva filipesilva added command: test P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Dec 30, 2016
@filipesilva filipesilva self-assigned this May 22, 2017
@hansl hansl added feature Issue that requests a new feature and removed type: enhancement labels Jan 30, 2018
@clydin clydin removed the P5 The team acknowledges the request but does not plan to address it, it remains open for discussion label Feb 1, 2018
@alan-agius4
Copy link
Collaborator

For the time being you can add text-summary in reports under coverageIstanbulReporter in the karma.conf.js file

    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, '<%= relativePathToWorkspaceRoot %>/coverage'),
      reports: ['html', 'lcovonly', 'text-summary'],
      fixWebpackSourcePaths: true
    },

@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: devkit/build-angular feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants