From fcc265787936d49f460e6ab8a549133e116685e0 Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Fri, 24 Apr 2020 10:32:16 -0700 Subject: [PATCH] update codecov script and documentation (#314) --- doc/source/user_guide/ug_testing.rst | 5 ++++- icepack.setup | 14 +++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/source/user_guide/ug_testing.rst b/doc/source/user_guide/ug_testing.rst index 5deb40042..79c211dcb 100755 --- a/doc/source/user_guide/ug_testing.rst +++ b/doc/source/user_guide/ug_testing.rst @@ -509,7 +509,10 @@ To use, submit a full test suite using a version of Icepack on the Consortium ma and the gnu compiler with the ``--codecov`` argument. The test suite will run and then a report will be generated and uploaded to the `codecov.io site `_ by the -**report_codecov.csh** script. +**report_codecov.csh** script. The env variable CODECOV_TOKEN needs to be defined +either in the environment or in a file named **~/.codecov_icepack_token**. That +token provides write permission to the Icepack codecov.io site and is available +by contacting the Consortium team directly. This is a special diagnostic test and does not constitute proper model testing. General use is not recommended, this is mainly used as a diagnostic to periodically diff --git a/icepack.setup b/icepack.setup index 19723c196..667cf83dd 100755 --- a/icepack.setup +++ b/icepack.setup @@ -458,10 +458,18 @@ EOF0 cat >! ${tsdir}/report_codecov.csh << EOF0 #!/bin/csh -f -setenv CODECOV_TOKEN "df12b574-8dce-439d-8d3b-ed7428d7598a" # consortium icepack -#setenv CODECOV_TOKEN "0b3feb13-0110-4618-821e-248c2f1f7cf3" # apcraig icepack -set report_name = "${shhash}:${branch}:${machine} ${testsuite}" +# define CODECOV_TOKEN env variable +if !(\$?CODECOV_TOKEN) then + if (-e ~/.codecov_icepack_token) then + source ~/.codecov_icepack_token + endif + if !(\$?CODECOV_TOKEN) then + echo "\${0}: ERROR, CODECOV_TOKEN env variable not defined" + exit 2 + endif +endif +set report_name = "${shhash}:${branch}:${machine} ${testsuite}" set use_curl = 1 EOF0