Skip to content

Adjust NUnit test results - #56

Open
kandoeniko wants to merge 1 commit into
Itiviti:masterfrom
kandoeniko:master
Open

Adjust NUnit test results#56
kandoeniko wants to merge 1 commit into
Itiviti:masterfrom
kandoeniko:master

Conversation

@kandoeniko

Copy link
Copy Markdown

No description provided.

if (env)
environment env
commandLine = commandLineExec
ignoreExitValue = ignoreFailures

Copy link
Copy Markdown
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?

if (!ignoreFailures) {
throw new GradleException("There are failing tests (exitCode = ${mbr.exitValue})")
}
return

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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