Skip to content

Commit 30f317d

Browse files
Produce CDash URLs to all builds and nonpassing tests for same repo version (#483)
This makes it easy to click on links to these other CDash URLs to see what is happening with all of the builds for the same repo version. The main target is for the GitHub Actions drivers for TriBITS testing. This makes it easy to get at those results. As part of this, I also renamed the function tribits_get_build_url_and_write_to_file() to tribits_get_cdash_build_url() and removed the ability to write to a file. (We just don't need that anymore and it is trivial to write a string to a file.)
1 parent 32cc1ad commit 30f317d

File tree

6 files changed

+364
-29
lines changed

6 files changed

+364
-29
lines changed

.github/workflows/tribits_testing.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
- name: URL to results on CDash
9494
run: |
9595
cd ..
96-
echo "Result on CDash are posted at:"
96+
echo "See results posted on CDash:"
97+
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
9798
echo
98-
cat tribits-build/BUILD/CDashBuildUrl.txt
99+
cat tribits-build/BUILD/CDashResults.txt
100+
echo
101+
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

test/ctest_driver/CTestDriverUnitTests.cmake

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,42 @@ include(TribitsReadTagFile)
5353
include(TribitsGetCDashUrlsInsideCTestS)
5454

5555

56+
function(unittest_tribits_get_cdash_revision_builds_url)
57+
58+
message("\n***")
59+
message("*** Testing tribits_get_cdash_revision_builds_url()")
60+
message("***\n")
61+
62+
tribits_get_cdash_revision_builds_url(
63+
CDASH_SITE_URL "somesite.com/my-cdash"
64+
PROJECT_NAME goodProject
65+
GIT_REPO_SHA1 "abc123"
66+
CDASH_REVISION_BUILDS_URL_OUT cdashRevesionBuildsUrlOut
67+
)
68+
unittest_compare_const(cdashRevesionBuildsUrlOut
69+
"somesite.com/my-cdash/index.php?project=goodProject&filtercount=1&showfilters=1&field1=revision&compare1=61&value1=abc123")
70+
71+
endfunction()
72+
73+
74+
function(unittest_tribits_get_cdash_revision_nonpassing_tests_url)
75+
76+
message("\n***")
77+
message("*** Testing tribits_get_cdash_revision_nonpassing_tests_url()")
78+
message("***\n")
79+
80+
tribits_get_cdash_revision_nonpassing_tests_url(
81+
CDASH_SITE_URL "somesite.com/my-cdash"
82+
PROJECT_NAME goodProject
83+
GIT_REPO_SHA1 "abc123"
84+
CDASH_REVISION_NONPASSING_TESTS_URL_OUT cdashRevisionNonpassingTestsUrlOut
85+
)
86+
unittest_compare_const(cdashRevisionNonpassingTestsUrlOut
87+
"somesite.com/my-cdash/queryTests.php?project=goodProject&filtercount=2&showfilters=1&filtercombine=and&field1=revision&compare1=61&value1=abc123&field2=status&compare2=62&value2=passed")
88+
89+
endfunction()
90+
91+
5692
function(unittest_tribits_read_ctest_tag_file)
5793

5894
message("\n***")
@@ -158,6 +194,8 @@ endfunction()
158194
unittest_initialize_vars()
159195

160196
# Run the unit test functions
197+
unittest_tribits_get_cdash_revision_builds_url()
198+
unittest_tribits_get_cdash_revision_nonpassing_tests_url()
161199
unittest_tribits_read_ctest_tag_file()
162200
unittest_tribits_get_cdash_site_from_drop_site_and_location()
163201
unittest_tribits_get_cdash_index_php_from_drop_site_and_location()

test/ctest_driver/TribitsExampleMetaProject/CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,19 @@ set(TribitsExampleMetaProject_COMMON_CONFIG_ARGS
9898
##########################################################################################
9999

100100

101+
set(cdash_build_url_expected_regex
102+
"https://testing[.]sandia[.]gov/cdash/index[.]php[?]project=TribitsExampleMetaProject&filtercount=3&showfilters=1&filtercombine=and&field1=site&compare1=61&value1=CustomSite&field2=buildname&compare2=61&value2=CTestDriver_TribitsExMetaProj_clone_default_branch_remote&field3=buildstamp&compare3=61&value3=[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-Continuous" )
103+
# NOTE: Above, we have to repeat [0-9] 8 times and 4 times for the regex for
104+
# the number of digits in the buildstarttime. CMake regex does not support
105+
# \d{8}-\d{4} :-(
106+
107+
set(cdash_revisions_builds_url_expected_regex
108+
"https://testing[.]sandia[.]gov/cdash/index.php[?]project=TribitsExampleMetaProject&filtercount=1&showfilters=1&field1=revision&compare1=61&value1=863461e3035d24c632e175c087761e83db28bdc3")
109+
110+
set(cdash_revisions_nonpassing_tests_expected_regex
111+
"https://testing[.]sandia[.]gov/cdash/queryTests.php[?]project=TribitsExampleMetaProject&filtercount=2&showfilters=1&filtercombine=and&field1=revision&compare1=61&value1=863461e3035d24c632e175c087761e83db28bdc3&field2=status&compare2=62&value2=passed" )
112+
113+
101114
tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_remote
102115
OVERALL_WORKING_DIRECTORY TEST_NAME
103116
OVERALL_NUM_MPI_PROCS 1
@@ -111,11 +124,19 @@ tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_re
111124
${COMMON_ENV_ARGS}
112125
TribitsExMetaProj_ENABLE_SECONDARY_TESTED_CODE=TRUE
113126
CTEST_BUILD_NAME=CTestDriver_TribitsExMetaProj_clone_default_branch_remote
127+
CTEST_SITE=CustomSite
114128
${CTEST_S_SCRIPT_ARGS}
115129
PASS_REGULAR_EXPRESSION_ALL
116130
"CTEST_NOTES_FILES=''"
117131
"First perform the initial checkout: .*/git. clone -o origin .*github.com.tribits/TribitsExampleMetaProject.git"
118132
"Perform checkout in directory: .*/TriBITS_CTestDriver_TribitsExMetaProj_clone_default_branch_remote"
133+
"Results will be submitted on CDash at the following links:"
134+
"Link to this build's results on CDash:"
135+
"${cdash_build_url_expected_regex}"
136+
"Link all builds for this repo version on CDash:"
137+
"${cdash_revisions_builds_url_expected_regex}"
138+
"Link to all nonpassing tests for all builds for this repo version on CDash:"
139+
"${cdash_revisions_nonpassing_tests_expected_regex}"
119140
"Calling ctest_update[(][)] to update base source repo '.*/TriBITS_CTestDriver_TribitsExMetaProj_clone_default_branch_remote/TribitsExampleMetaProject"
120141
"Old revision of repository is: [a-z0-9]+"
121142
"New revision of repository is: [a-z0-9]+"
@@ -315,6 +336,11 @@ tribits_add_advanced_test( CTestDriver_TribitsExMetaProj_clone_default_branch_re
315336
# * Makes sure some git commit SHA1s are shown in 'Old/New revision of
316337
# repository' printouts from ctest_update().
317338
#
339+
# * Checks that CDash URLs that get produced, including for all builds with
340+
# * the same repo version. (This check has to be here since the base
341+
# * project repo must have a .git/ directory and we must know the exact SHA1
342+
# * of that repo for the test, which we don in this case.)
343+
#
318344
# NOTE: The reason that so many tests are done in a single ctest test is the
319345
# cost of the initial configure which checks the compilers which is very
320346
# expensive. The other runs use

test/ctest_driver/TribitsExampleProject/CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,8 @@ function(generate_aao_tests)
12641264
# CONFIGURE_OPTIONS list is checked to make sure that it does not change
12651265
# without being noticed. Follow-on tests will not check all of that.
12661266

1267-
set(cdash_url_expected_regex
1267+
1268+
set(cdash_build_url_expected_regex
12681269
"https://cdash[.]site[.]com/cdash/index[.]php[?]project=CustomTribitsExProj&filtercount=3&showfilters=1&filtercombine=and&field1=site&compare1=61&value1=My%20Site&field2=buildname&compare2=61&value2=TriBITS_CTestDriver_AAOP_CDASH_URL&field3=buildstamp&compare3=61&value3=[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-Custom%20CDash%20Group" )
12691270
# NOTE: Above, we have to repeat [0-9] 8 times and 4 times for the regex for
12701271
# the number of digits in the buildstarttime. CMake regex does not support
@@ -1285,7 +1286,7 @@ function(generate_aao_tests)
12851286
CTEST_DASHBOARD_ROOT=PWD
12861287
${AAO_COMMON_ENV_ARGS}
12871288
CTEST_PARALLEL_LEVEL=3
1288-
CTEST_DO_SUBMIT=OFF # Never submit this
1289+
CTEST_DO_SUBMIT=OFF # Never submit this (see below note)
12891290
CTEST_SITE="My Site"
12901291
CTEST_DROP_SITE="cdash.site.com"
12911292
CTEST_PROJECT_NAME="CustomTribitsExProj"
@@ -1299,17 +1300,19 @@ function(generate_aao_tests)
12991300
"NONE does not exist, skipping extra repositories"
13001301
"Final set of enabled packages: SimpleCxx 1"
13011302
"Final set of enabled SE packages: SimpleCxx 1"
1302-
"Results will be submitted to CDash at:"
1303+
"Results will be submitted on CDash at the following links:"
1304+
"Link to this build's results on CDash:"
1305+
"${cdash_build_url_expected_regex}"
13031306
"File '' does NOT exist so all tests passed"
1304-
"See results submitted to CDash at:"
1305-
"${cdash_url_expected_regex}"
1307+
"See results submitted on CDash at the following links:"
13061308
"TRIBITS_CTEST_DRIVER: OVERALL: ALL PASSED"
13071309
ALWAYS_FAIL_ON_NONZERO_RETURN
13081310
TEST_2
1309-
MESSAGE "Check that CDashBuildUrl.txt exists and lists the right URL."
1310-
CMND cat ARGS BUILD/CDashBuildUrl.txt
1311+
MESSAGE "Check that CDashResults.txt exists and lists the right URL."
1312+
CMND cat ARGS BUILD/CDashResults.txt
13111313
PASS_REGULAR_EXPRESSION_ALL
1312-
"${cdash_url_expected_regex}"
1314+
"Link to this build's results on CDash:"
1315+
"${cdash_build_url_expected_regex}"
13131316
)
13141317
# NOTE: The above test is never actually submitted to CDash, even when
13151318
# ${PACKAGE_NAME}_CTEST_DRIVER_SUBMIT_TO is set. This is so we can

tribits/ctest_driver/TribitsCTestDriverCore.cmake

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,10 +2093,15 @@ function(tribits_ctest_driver)
20932093
ctest_start(${CTEST_START_ARGS})
20942094

20952095
tribits_remember_if_configure_attempted()
2096-
tribits_get_build_url_and_write_to_file(CDASH_BUILD_URL
2097-
"${CTEST_BINARY_DIRECTORY}/CDashBuildUrl.txt")
2098-
tribits_print_cdash_url("Results will be submitted to CDash at:"
2099-
"${CDASH_BUILD_URL}")
2096+
2097+
tribits_get_cdash_results_string_and_write_to_file(
2098+
CDASH_RESULTS_STRING_OUT CDASH_RESULTS_STRING
2099+
CDASH_RESULTS_FILE_OUT "${CTEST_BINARY_DIRECTORY}/CDashResults.txt" )
2100+
message("Results will be submitted on CDash at the following links:\n\n"
2101+
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"
2102+
"${CDASH_RESULTS_STRING}\n"
2103+
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
2104+
)
21002105

21012106
message(
21022107
"\n***"
@@ -2370,8 +2375,11 @@ function(tribits_ctest_driver)
23702375

23712376
report_queued_errors()
23722377

2373-
tribits_print_cdash_url("See results submitted to CDash at:"
2374-
"${CDASH_BUILD_URL}")
2378+
message("\nSee results submitted on CDash at the following links:\n\n"
2379+
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"
2380+
"${CDASH_RESULTS_STRING}\n"
2381+
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
2382+
)
23752383

23762384
if ((NOT UPDATE_FAILED) AND ("${${PROJECT_NAME}_FAILED_PACKAGES}" STREQUAL ""))
23772385
message(

0 commit comments

Comments
 (0)