From 7f930f875e782e9751a6e0a3182915a0fdc8a1d4 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 3 Nov 2019 20:25:55 -0500 Subject: [PATCH] Jenkins store SITL unit test results --- .ci/Jenkinsfile-SITL_tests_coverage | 2 +- Jenkinsfile | 18 ++++ Tools/CTest2JUnit.xsl | 120 ------------------------- platforms/posix/cmake/sitl_tests.cmake | 13 --- 4 files changed, 19 insertions(+), 134 deletions(-) delete mode 100644 Tools/CTest2JUnit.xsl diff --git a/.ci/Jenkinsfile-SITL_tests_coverage b/.ci/Jenkinsfile-SITL_tests_coverage index 9757d4c1d3..9a8cdc1cd7 100644 --- a/.ci/Jenkinsfile-SITL_tests_coverage +++ b/.ci/Jenkinsfile-SITL_tests_coverage @@ -107,7 +107,7 @@ pipeline { sh 'export' sh 'make distclean' sh 'git fetch --tags' - sh 'make px4_sitl_test test_results_junit' + sh 'make tests' withCredentials([string(credentialsId: 'FIRMWARE_CODECOV_TOKEN', variable: 'CODECOV_TOKEN')]) { sh 'curl -s https://codecov.io/bash | bash -s - -F unittest' } diff --git a/Jenkinsfile b/Jenkinsfile index 38364255cf..436577f835 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -262,6 +262,24 @@ pipeline { } post { always { + // Process the CTest xml output with the xUnit plugin + xunit ( + testTimeMargin: '3000', + thresholdMode: 1, + thresholds: [ + skipped(failureThreshold: '0'), + failed(failureThreshold: '0') + ], + reduceLog: false, + tools: [CTest( + pattern: 'build/px4_sitl_test/Testing/**/*.xml', + deleteOutputFiles: true, + failIfNotNew: false, + skipNoTestFiles: true, + stopProcessingIfError: true + )] + ) + sh 'make distclean' } } diff --git a/Tools/CTest2JUnit.xsl b/Tools/CTest2JUnit.xsl deleted file mode 100644 index 8ba21f4e60..0000000000 --- a/Tools/CTest2JUnit.xsl +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - BuildName: - BuildStamp: - Name: - Generator: - CompilerName: - OSName: - Hostname: - OSRelease: - OSVersion: - OSPlatform: - Is64Bits: - VendorString: - VendorID: - FamilyID: - ModelID: - ProcessorCacheSize: - NumberOfLogicalCPU: - NumberOfPhysicalCPU: - TotalVirtualMemory: - TotalPhysicalMemory: - LogicalProcessorsPerPhysical: - ProcessorClockFrequency: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/platforms/posix/cmake/sitl_tests.cmake b/platforms/posix/cmake/sitl_tests.cmake index 04a28a9fe6..a0d9ffbea1 100644 --- a/platforms/posix/cmake/sitl_tests.cmake +++ b/platforms/posix/cmake/sitl_tests.cmake @@ -145,16 +145,3 @@ if (CMAKE_BUILD_TYPE STREQUAL Coverage) setup_target_for_coverage(test_coverage "${CMAKE_CTEST_COMMAND} --output-on-failure -T Test" tests) setup_target_for_coverage(generate_coverage "${CMAKE_COMMAND} -E echo" generic) endif() - -add_custom_target(test_results_junit - COMMAND xsltproc ${PX4_SOURCE_DIR}/Tools/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml - DEPENDS test_results - COMMENT "Converting ctest output to junit xml" - WORKING_DIRECTORY ${PX4_BINARY_DIR}) -set_target_properties(test_results_junit PROPERTIES EXCLUDE_FROM_ALL TRUE) - -add_custom_target(test_cdash_submit - COMMAND ${CMAKE_CTEST_COMMAND} -D Experimental - USES_TERMINAL - WORKING_DIRECTORY ${PX4_BINARY_DIR}) -set_target_properties(test_cdash_submit PROPERTIES EXCLUDE_FROM_ALL TRUE)