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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit formatter output missing successfully linted files #13902

Closed
smsalisbury opened this Issue Mar 13, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@smsalisbury
Copy link

smsalisbury commented Mar 13, 2019

馃悶 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [x] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No

Description

Many CI/CD solutions expect JUnit reports to have test cases for both failed and successful tests. The ng lint --format=junit command only reports on failed linting cases. This causes these CI/CD solutions to fail on parsing the JUnit linting report when all files pass.

The latest release of TSLint (v5.14) now outputs the correct format. I'd expect ng lint to have the same output.

馃敩 Minimal Reproduction

ng new junit-test
cd junit-test
npm i -D tslint@5.14.0
ng lint junit-test --format=junit

Output is:

<?xml version="1.0" encoding="utf-8"?><testsuites package="tslint"></testsuites>

馃敟 Exception or Error

I'd expect the output to be the same as if I ran the command:

npx tslint --project src/tslint.json --format junit

Output:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites package="tslint">
   <testsuite name="D:/i5/tmp/junit-test/src/app/app.component.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/app/app.component.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/app/app.module.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/app/app.module.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/environments/environment.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/environments/environment.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/main.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/main.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/polyfills.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/polyfills.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/test.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/test.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/app/app.component.spec.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/app/app.component.spec.ts" />
   </testsuite>
   <testsuite name="D:/i5/tmp/junit-test/src/environments/environment.prod.ts" errors="0">
      <testcase name="D:/i5/tmp/junit-test/src/environments/environment.prod.ts" />
   </testsuite>
</testsuites>

馃實 Your Environment


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


Angular CLI: 7.3.5
Node: 10.15.0
OS: win32 x64
Angular: 7.2.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.5
@angular-devkit/build-angular     0.13.5
@angular-devkit/build-optimizer   0.13.5
@angular-devkit/build-webpack     0.13.5
@angular-devkit/core              7.3.5
@angular-devkit/schematics        7.3.5
@angular/cli                      7.3.5
@ngtools/webpack                  7.3.5
@schematics/angular               7.3.5
@schematics/update                0.13.5
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0
@alan-agius4

This comment has been minimized.

Copy link
Collaborator

alan-agius4 commented Mar 13, 2019

Hi, this should been have been addressed with this PR #13788

And will be available in the next version 8 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.