I am generating a file that captures all of the steps that occur during CI such that devs can grab the file login to a cluster and run the script to reproduce the environment, config, build etc. steps that occured during CI job. The only way I could think to do this is via a test with ATTACHED_FILES. I was told that I should generate a dashboard script and use the ctest_submit function. At this point, we don’t use any ctest scripts and propagate information using a CTestConfiguration.ini file. Is there file attachment entry that I could drop in the CTestConfiguration.ini file for this?
Is it possible for the two to coexist? For example, can I use ctest -T for everything up to the submission step and then call the a ctest script to handle submission - at least until I shift everything over to a ctest script?
Possibly. If a dashboard script picks up where ctest -T left off, it would need to start with ctest_start(APPEND). However, that may not be necessary - see my suggestion to use --extra-submit.
The --extra-submit option is more for internal use by CTest/CDash, not for uploading arbitrary files as attachments to a run. You probably want the --add-note option instead. E.g.
ctest -T Submit --add-note JobNote.txt
Or within a ctest script:
set(CTEST_NOTES_FILES path/to/JobNote.txt)
ctest_submit(PARTS Notes)
unset(CTEST_NOTES_FILES) # To prevent uploading again later
Job notes are available by clicking on the view notes link just under the build name on the summary page for the build.
You might also be able to use the ctest_upload() command in conjunction with ctest_submit(PARTS Upload), but I don’t recall why I chose to use the above pattern instead in my job scripts.
but I go to the dashboard and I do not see any results for the entire job. Is there a setting a need to change in cdash to allow for submissions with notes?
There is a “view notes” link below “Site Name” and “Build Name” (at the top of the build page) in CDash. As an example, take a look at this build and its notes.
Thanks Kyle. For starters, I am on 2.5.0 (perhaps that is the source of my problems) and I see a notes section when clicking on the build name in the list of builds. The notes section is empty as one would expect for the following case:
there is no corresponding build in the dashboard to dive into to find the notes. It is as if cdash doesn’t know where to file the build and the corresponding results so it just goes into some black hole.
I’m wondering about the presence/placement of the -- on that command line. I don’t normally invoke things this way, I use a dedicated ci_job.cmake script and invoke it with ctest -S ci_job.cmake, so I’d have to test further to confirm. But in the meantime, try putting -- before the --add-notes option or omitting -- altogether. I won’t know what’s the correct approach until I’ve had a dig through the source code.