-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed JUnit test-by-config reporting #1160
Conversation
232f542
to
42a945a
Compare
@beatfactor - Should I go back and file an issue for this or can we go with just the pull request? |
For now it's ok, but maybe in the future, it would be appreciated. |
@beatfactor - if you'd like I can add a few tests for file content to make sure it includes the |
Sure, tests are always welcome. |
42a945a
to
d8e3e17
Compare
@beatfactor - okay, added content tests. |
@bitwiseman
|
@drptbl - It changes the file path that the file are written to. Check the glob pattern you're using for finding the files. Make sure it is something like |
@bitwiseman Sorry, I wasn't aware of that, will do further testing. Is JUnit reports file path change needed and intended? It will break most Jenkins builds after merge to master. |
@beatfactor @drptbl see https://github.com/nightwatchjs/nightwatch/pull/1160/files#diff-11f6da1d76940abb03b522fcd51edb9fR112 I would argue that Nightwatch already makes an arbitrary depth tree for output files, so one more level that adds clarity is a good thing, and patterns that look for these files should already be loading that full tree (via |
Maybe we should just add the classname attribute for now. Would that make any difference? |
d8e3e17
to
9fe7ff5
Compare
Okay, I removed the file path change. It there is still a change to the module name inside the file but that is required as before the module name wasn't including the configuration. |
@beatfactor - I think this is all set. |
@@ -56,6 +56,22 @@ module.exports = new (function() { | |||
|
|||
adaptAssertions(module); | |||
|
|||
var filename = moduleName + '.xml'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really in favour of this change, I don't think it's necessary and the potential impact is unknown. I'd rather just stick to the classname attribute change without anymore changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to redo this with tests that verify the current output and then test the change.
I'm going to follow the template of https://github.com/karma-runner/karma-junit-reporter
9fe7ff5
to
a9927f9
Compare
@beatfactor Thanks for your patience though these multiple iterations. |
a9927f9
to
ed4ac20
Compare
@beatfactor - It is not clear to me what check failed. The build reported success and then the process in travis exited 1. |
ed4ac20
to
fec898a
Compare
jshint validation failed. |
fec898a
to
d3528fe
Compare
@beatfactor - Ah, okay, fixed. |
@beatfactor ? Ping? |
@beatfactor - Is there anything else for me to do here? |
@beatfactor - I've made the changes your requested and all tests are passing. Can we merge? |
@beatfactor - Hello? Are you there? |
Preparing for adding classname to junit file
Without some way to distinguish between different config runs of the same tests, Unit reporters will tend to treat multiple results for the same test case of the duplicates. Jenkins JUnit report will ignore these "duplicates" producing very confusing test results. The change add a "class path" the results based on configuration and file path. This allows reporter consumers to process the results correctly as different results instances.
d3528fe
to
9dbf21e
Compare
The combination of testsuite name and package must be unique in the case of multiple junit files or reporting systems may ignore later occurrences as duplicates. It turns out that the testsuite name should be the full class name anyway. https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd#L157
9dbf21e
to
370a3a6
Compare
@beatfactor - Rebased on HEAD and added one more changed based on feedback from @jk171505. |
@beatfactor, this feature seems to be crucial when testing multi envs, is there a chance to merge it into master? |
Sorry for the delay, I'll look into it in the next few days. |
@beatfactor - I totally understand getting busy and not having time to review. Whenever you get the chance. |
@beatfactor - Ping? |
Added classname attribute in v0.9.13 |
Without some way to distinguish between different config runs of the same tests,
Unit reporters will tend to treat multiple results for the same test case of the duplicates.
Jenkins JUnit report will ignore these "duplicates" producing very confusing test results.
The change add a "class path" the results based on configuration and file path. This allows
reporter consumers to process the results correctly as different results instances.