Upload file to dashboard file generated during CI

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?

Thanks,

David

A quick glance at the documentation for CTestConfiguration.ini suggests that there is no such entry.

I would strongly suggest using the dashboard script if you can. It’s far more flexible than the ctest -T interface.

Actually, now that I look again, ctest does have a --extra-submit option. Will this be sufficient?

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.

I am attempting this now - thanks!

I see that the file was uploaded but I don’t know where to find it in cdash…

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.

Thanks Craig! I will test this now. Hope all is well. --David

Thanks again for the help. Turns out that the option is --add-notes which I can’t seem to get to work.

Here is my original command:

ctest -M Experimental -T Submit -- --track Continuous

When I do this - I see the following submission output:

Submit files
  Send to track: Continuous   
  SubmitURL: https://my.cdash   
  Uploaded: <path>/Configure.xml   
  Uploaded: <path>/Build.xml   
  Uploaded: <path>/Test.xml   
  Uploaded: <path>/Done.xml  
  Submission successful

and I can go to the dashboard and view results for the test.

When I try to add notes a la:

ctest -M Experimental -T Submit --add-notes job_notes -- --track Continuous

the submission appears to succeed:

Create notes file	
  Add file: my_notes
Submit files
  Send to track: Continuous   
  SubmitURL: https://my.cdash   
  Uploaded: <path>/Configure.xml   
  Uploaded: <path>/Build.xml   
  Uploaded: <path>/Test.xml   
  Uploaded: <path>/Notes.xml   
  Uploaded: <path>/Done.xml  
  Submission successful

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:

ctest -M Experimental -T Submit -- --track Continuous

The problem I have is when doing the following:

ctest -M Experimental -T Submit --add-notes my_notes -- --track Continuous

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 am on 2.5.0 (perhaps that is the source of my problems)

CDash 2.5.0 should be fine, it’s what we’re using at work where I use this notes feature regularly.

The problem I have is when doing the following:

ctest -M Experimental -T Submit --add-notes my_notes -- --track Continuous

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.

Finally got around to using this:

set(CTEST_NOTES_FILES path/to/JobNote.txt)
ctest_submit(PARTS Notes)
unset(CTEST_NOTES_FILES) 

and it works! Never got it to work in dashboard mode…