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

Adjust NUnit test results #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

kandoeniko
Copy link

No description provided.

@@ -299,20 +300,23 @@ class NUnit extends ConventionTask {
if (env)
environment env
commandLine = commandLineExec
ignoreExitValue = ignoreFailures
Copy link
Contributor

Choose a reason for hiding this comment

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

why hardcode the setting instead of using the argument?

//failed tests but no error
if (!ignoreFailures) {
throw new GradleException("There are failing tests (exitCode = ${mbr.exitValue})")
}
return
Copy link
Contributor

Choose a reason for hiding this comment

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

exitValue != 0 ?

def xmlFile = new XmlParser().parse(testResultsFile)

if (!isNumberOfFailedTestsConsistentWithOverallResult(xmlFile)) {
logger.info("The overall result of the Test Results is not consistent with the number of failed tests. Adjusting test results...")
Copy link
Contributor

Choose a reason for hiding this comment

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

warn?

return isFailedResult
}

private static String getFailingTestCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what is this


private static String getFailingTestCase() {
return '''
<test-suite type="TestSuite" id="9999-9996" name="Ullink" fullname="Ullink.Test" runstate="Runnable" testcasecount="1" result="Failed" site="Child" start-time="2019-05-06 07:10:49Z" end-time="2019-05-06 07:10:49Z" duration="0.100747" total="1" passed="0" failed="1" warnings="0" inconclusive="0" skipped="0" asserts="1">
Copy link
Contributor

Choose a reason for hiding this comment

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

the harcoded values could cause issues, like id, start-time etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants