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

feat(concatjs): enable junit report for karma_web_test #2630

Merged
merged 1 commit into from
May 4, 2021
Merged

feat(concatjs): enable junit report for karma_web_test #2630

merged 1 commit into from
May 4, 2021

Conversation

kyubisation
Copy link
Contributor

This PR enables junit reports for karma_web_test, by adding karma-junit-reporter as a
peer dependency and adding an appropriate configuration that works with bazel.

BREAKING CHANGE: karma-junit-reporter is now a peer dependency of @bazel/concatjs

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
    It's unclear to me if this is required or if this is part of base expectation

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #983

What is the new behavior?

Junit Report is created at path specified via the XML_OUTPUT_FILE environment variable.

Does this PR introduce a breaking change?

  • Yes
  • No

karma-junit-reporter is now a peer dependency of @bazel/concatjs. Add the karma-junit-reporter package as a dev dependency to your project (yarn add karma-junit-reporter --dev or npm install karma-junit-reporter --save-dev).

Other information

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a breaking change, can you make the new dependency optional? just catch exceptions from require('karma-junit-reporter') and if it's e.code == 'MODULE_NOT_FOUND' then you disable the new feature

@kyubisation
Copy link
Contributor Author

Sure, I'll refactor it accordingly.

@@ -4298,6 +4298,14 @@ karma-jasmine@2.0.1:
dependencies:
jasmine-core "^3.3"

karma-junit-reporter@2.0.1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need at least one example that doesn't include this dependency to verify that we didn't accidentally introduce a breaking change.

My preference is to just update one of the examples/ to include the dependency so it's possible to observe the XML output from a karma test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the dependency from angular_view_engine and protocol_buffers and left it in web_testing and angular (since this is the one I'm primarily interested in).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool as long as there's a mix

examples/web_testing/package.json Show resolved Hide resolved
This PR enables junit reports for karma_web_test, by adding karma-junit-reporter as a
peer dependency and adding an appropriate configuration that works with bazel.
karma-junit-reporter is now a peer dependency of @bazel/concatjs
@@ -4298,6 +4298,14 @@ karma-jasmine@2.0.1:
dependencies:
jasmine-core "^3.3"

karma-junit-reporter@2.0.1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool as long as there's a mix

@alexeagle alexeagle merged commit 28e8d23 into bazel-contrib:stable May 4, 2021
@alexeagle
Copy link
Collaborator

Thanks!!

@kyubisation
Copy link
Contributor Author

No problem. Thanks for the pointers. 👍

twheys pushed a commit to twheys/rules_nodejs that referenced this pull request Jan 13, 2022
…#2630)

This PR enables junit reports for karma_web_test, by adding karma-junit-reporter as a
peer dependency and adding an appropriate configuration that works with bazel.
karma-junit-reporter is now a peer dependency of @bazel/concatjs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants