# Upload file to dashboard file generated during CI

**URL:** https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152
**Category:** Usage
**Created:** [November 6, 2019, 10:25pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152 "2019-11-06T22:25:27Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 6, 2019, 10:25pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/1 "2019-11-06T22:25:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 6, 2019, 10:31pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/2 "2019-11-06T22:31:54Z")

</div>

A quick glance at the [documentation](https://cmake.org/cmake/help/latest/manual/ctest.1.html#dashboard-client-configuration) 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.

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 6, 2019, 10:35pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/3 "2019-11-06T22:35:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 6, 2019, 10:35pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/4 "2019-11-06T22:35:30Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 6, 2019, 10:37pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/5 "2019-11-06T22:37:30Z")

</div>

> [@David\_Dixon](#):
>
> Is it possible for the two to coexist?

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`.

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 6, 2019, 10:40pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/6 "2019-11-06T22:40:29Z")

</div>

> [@kyle.edwards](#):
>
> `--extra-submit`

I am attempting this now - thanks!

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 6, 2019, 11:02pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/7 "2019-11-06T23:02:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 6, 2019, 11:41pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/8 "2019-11-06T23:41:28Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 6, 2019, 11:48pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/9 "2019-11-06T23:48:26Z")

</div>

> [@craig.scott](#):
>
> –add-note

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

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 7, 2019, 3:22pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/10 "2019-11-07T15:22:44Z")

</div>

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:

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

```

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

```auto
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:

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

```

the submission appears to succeed:

```auto
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?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [November 7, 2019, 3:25pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/11 "2019-11-07T15:25:53Z")

</div>

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](https://open.cdash.org/buildSummary.php?buildid=6196636) build and its [notes](https://open.cdash.org/viewNotes.php?buildid=6196636).

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [November 7, 2019, 3:37pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/12 "2019-11-07T15:37:31Z")

</div>

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:

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

```

 ![46%20AM](https://discourse.cmake.org/uploads/default/original/1X/e1df4dd4c263048e623aea327d86eefb8ffb3b62.png)

The problem I have is when doing the following:

```auto
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.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 8, 2019, 9:23pm UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/13 "2019-11-08T21:23:15Z")

</div>

> 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:
> 
> ```auto
> 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.

---

<div class="post-metadata">

### Author: ![David\_Dixon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/david_dixon/32/127_2.png) [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)
#### Post date: [December 12, 2019, 4:20am UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152/14 "2019-12-12T04:20:35Z")

</div>

Finally got around to using this:

```auto
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…
