-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add unit tests to the JUnit xml report generation #3184
Add unit tests to the JUnit xml report generation #3184
Conversation
@@ -386,9 +387,11 @@ object TestModule { | |||
tests={testResults.length.toString} | |||
failures={testResults.count(_.status == Status.Failure.toString).toString} | |||
errors={testResults.count(_.status == Status.Error.toString).toString} | |||
skipped={testResults.count(_.status == Status.Skipped.toString).toString} | |||
skipped={ | |||
testResults.count(testResult => SkippedStatus.contains(testResult.status)).toString |
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.
You sometimes use Status.toString
and sometimes Status.name()
. Is there a difference? Can we always use name
?
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.
Hi @lefou
You are right I should always use the Enum.name()
function which is the right function to get the string representation of the enum name. I will fix it. BTW I introduced constants for those names it's my mistake to not use them here ;)
@@ -206,6 +206,10 @@ trait TestModule | |||
|
|||
object TestModule { | |||
private val FailedTestReportCount = 5 | |||
private val ErrorStatus = Status.Error.name() | |||
private val FailureStatus = Status.Failure.name() | |||
private val SkippedStatus = |
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.
Should this be plural?
private val SkippedStatus = | |
private val SkippedStates = |
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.
Looks good to me. Thank you!
Add unit tests to the JUnit XML report generation.