Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-51347] Test Status "notrun" being reported as "failed" test
Fix XSL to not include in failure count also skipped tests.
- Loading branch information
Showing
8 changed files
with
212 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 46 additions & 7 deletions
53
src/test/java/org/jenkinsci/plugins/xunit/types/CTestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,55 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014, Gregory Boissinot, Falco Nikolas | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package org.jenkinsci.plugins.xunit.types; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
/** | ||
* @author Gregory Boissinot | ||
*/ | ||
@RunWith(Parameterized.class) | ||
public class CTestTest extends AbstractTest { | ||
|
||
@Parameters(name = "testcase{1}: {0}") | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][] { { "testcase1", 1 }, // | ||
{ "testcase2", 2 }, // | ||
{ "skipped test are counted as failures", 3 } // | ||
}); | ||
} | ||
|
||
public CTestTest(String testName, int testNumber) { | ||
super(CTest.class, resolveInput("ctest", testNumber), resolveOutput("ctest", testNumber)); | ||
} | ||
|
||
@Override | ||
@Test | ||
public void testTestCase1() throws Exception { | ||
convertAndValidate(CTestInputMetric.class, "ctest/testcase1/input.xml", "ctest/testcase1/result.xml"); | ||
convertAndValidate(CTestInputMetric.class, "ctest/testcase2/input.xml", "ctest/testcase2/result.xml"); | ||
public void verifyXSLT() throws Exception { | ||
super.verifyXSLT(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/test/resources/org/jenkinsci/plugins/xunit/types/ctest/testcase2/result.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
src/test/resources/org/jenkinsci/plugins/xunit/types/ctest/testcase3/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Site BuildName="(empty)" | ||
BuildStamp="20180515-1731-Experimental" | ||
Name="(empty)" | ||
Generator="ctest-3.11.0" | ||
CompilerName="" | ||
CompilerVersion="" | ||
OSName="Linux" | ||
Hostname="3tnavBuild" | ||
OSRelease="4.4.0-116-generic" | ||
OSVersion="#140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018" | ||
OSPlatform="x86_64" | ||
Is64Bits="1" | ||
VendorString="GenuineIntel" | ||
VendorID="Intel Corporation" | ||
FamilyID="6" | ||
ModelID="44" | ||
ProcessorCacheSize="12288" | ||
NumberOfLogicalCPU="8" | ||
NumberOfPhysicalCPU="8" | ||
TotalVirtualMemory="979" | ||
TotalPhysicalMemory="7982" | ||
LogicalProcessorsPerPhysical="1" | ||
ProcessorClockFrequency="3458" | ||
> | ||
<Testing> | ||
<StartDateTime>May 15 10:31 PDT</StartDateTime> | ||
<StartTestTime>1526405497</StartTestTime> | ||
<TestList> | ||
<Test>./libs/QVtkVisualization/tests/LoggingSinkTests.loggingSinkTest_CallLoggingCallback</Test> | ||
<Test>./tools/simulator/test/simulator.SimulatorTest.readEventFile_mediaDetectedEvent_oneSignalEmitted</Test> | ||
</TestList> | ||
<Test Status="passed"> | ||
<Name>LoggingSinkTests.loggingSinkTest_CallLoggingCallback</Name> | ||
<Path>./libs/QVtkVisualization/tests</Path> | ||
<FullName>./libs/QVtkVisualization/tests/LoggingSinkTests.loggingSinkTest_CallLoggingCallback</FullName> | ||
<FullCommandLine>/home/ctc/jenkins/workspace/build_TNAV-dev_Pull-Request/build/libs/QVtkVisualization/tests/QVtkVisualizationTestPublicAPI "--gtest_filter=LoggingSinkTests.loggingSinkTest_CallLoggingCallback"</FullCommandLine> | ||
<Results> | ||
<NamedMeasurement type="numeric/double" name="Execution Time"> | ||
<Value>0.0074303</Value> | ||
</NamedMeasurement> | ||
<NamedMeasurement type="numeric/double" name="Processors"> | ||
<Value>1</Value> | ||
</NamedMeasurement> | ||
<NamedMeasurement type="text/string" name="Completion Status"> | ||
<Value>Completed</Value> | ||
</NamedMeasurement> | ||
<NamedMeasurement type="text/string" name="Command Line"> | ||
<Value>/home/ctc/jenkins/workspace/build_TNAV-dev_Pull-Request/build/libs/QVtkVisualization/tests/QVtkVisualizationTestPublicAPI "--gtest_filter=LoggingSinkTests.loggingSinkTest_CallLoggingCallback"</Value> | ||
</NamedMeasurement> | ||
<Measurement> | ||
<Value>Note: Google Test filter = LoggingSinkTests.loggingSinkTest_CallLoggingCallback | ||
[==========] Running 1 test from 1 test case. | ||
[----------] Global test environment set-up. | ||
[----------] 1 test from LoggingSinkTests | ||
[ RUN ] LoggingSinkTests.loggingSinkTest_CallLoggingCallback | ||
[ OK ] LoggingSinkTests.loggingSinkTest_CallLoggingCallback (0 ms) | ||
[----------] 1 test from LoggingSinkTests (0 ms total) | ||
|
||
[----------] Global test environment tear-down | ||
[==========] 1 test from 1 test case ran. (0 ms total) | ||
[ PASSED ] 1 test. | ||
</Value> | ||
</Measurement> | ||
</Results> | ||
</Test> | ||
<Test Status="notrun"> | ||
<Name>simulator.SimulatorTest.readEventFile_mediaDetectedEvent_oneSignalEmitted</Name> | ||
<Path>./tools/simulator/test</Path> | ||
<FullName>./tools/simulator/test/simulator.SimulatorTest.readEventFile_mediaDetectedEvent_oneSignalEmitted</FullName> | ||
<FullCommandLine></FullCommandLine> | ||
<Results> | ||
<NamedMeasurement type="numeric/double" name="Processors"> | ||
<Value>1</Value> | ||
</NamedMeasurement> | ||
<NamedMeasurement type="text/string" name="Completion Status"> | ||
<Value>Disabled</Value> | ||
</NamedMeasurement> | ||
<NamedMeasurement type="text/string" name="Command Line"> | ||
<Value></Value> | ||
</NamedMeasurement> | ||
<Measurement> | ||
<Value>Disabled</Value> | ||
</Measurement> | ||
</Results> | ||
</Test> | ||
<EndDateTime>May 15 10:37 PDT</EndDateTime> | ||
<EndTestTime>1526405879</EndTestTime> | ||
<ElapsedMinutes>6</ElapsedMinutes> | ||
</Testing> | ||
</Site> |
24 changes: 24 additions & 0 deletions
24
src/test/resources/org/jenkinsci/plugins/xunit/types/ctest/testcase3/result.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xunit="http://www.xunit.org"> | ||
<testsuite name="CTest" tests="2" time="382.000" failures="0" errors="0" skipped="1"> | ||
<testcase classname="projectroot.libs.QVtkVisualization.tests" name="LoggingSinkTests.loggingSinkTest_CallLoggingCallback" time="0.007"> | ||
<system-out>Note: Google Test filter = LoggingSinkTests.loggingSinkTest_CallLoggingCallback | ||
[==========] Running 1 test from 1 test case. | ||
[----------] Global test environment set-up. | ||
[----------] 1 test from LoggingSinkTests | ||
[ RUN ] LoggingSinkTests.loggingSinkTest_CallLoggingCallback | ||
[ OK ] LoggingSinkTests.loggingSinkTest_CallLoggingCallback (0 ms) | ||
[----------] 1 test from LoggingSinkTests (0 ms total) | ||
|
||
[----------] Global test environment tear-down | ||
[==========] 1 test from 1 test case ran. (0 ms total) | ||
[ PASSED ] 1 test.</system-out> | ||
</testcase> | ||
<testcase classname="projectroot.tools.simulator.test" | ||
name="simulator.SimulatorTest.readEventFile_mediaDetectedEvent_oneSignalEmitted" | ||
time="0.000"> | ||
<skipped/> | ||
<system-out>Disabled</system-out> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |