Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code coverage documentation #436

Merged
merged 7 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions configuration/scripts/tests/cice_test_codecov.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/csh

# This was a script on gordon
# Should run this interactively with cut and paste due to manual work needed to generate
# test_cice_icepack repository

#PBS -N cice_test
#PBS -q standard
#PBS -A NRLSS03755018
#PBS -l application=Regional-Arctic-System-Model
#PBS -l select=1:ncpus=32:mpiprocs=32
#PBS -l walltime=24:00:00
#PBS -j oe
#PBS -M [email protected]
#PBS -m be

module load costinit git

set scrdir = "~"
set testdir = "~/cice_testing"
set date0 = `date -u "+%y%m%d"`
set date = ${date0}cc

mkdir -p ${testdir}

cd ${testdir}

# Check out current cice master
git clone https://github.com/cice-consortium/cice cice.master.${date} --recursive
cd cice.master.${date}
set hash = `git show --oneline -s | cut -f 1 -d " "`
apcraig marked this conversation as resolved.
Show resolved Hide resolved
cd ../

# Check out test_cice_icepack and update from cice master
git clone https://github.com/apcraig/test_cice_icepack test_cice_icepack.${date}
Copy link
Member

@phil-blain phil-blain Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the clone is done using SSH ([email protected]:apcraig/Test_CICE_Icepack.git) instead of HTTPS, the script will not ask for a password for git push as long as the SSH keys are correctly configured

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if we want to this to be easier to setup for others, I think the username (here apcraig) should be a script parameter, or at least an environment variable.

But as I wrote in #89 (comment), I think it would be more "official" if the "test_cice_icepack" repo (or whatever we call it) was under the CICE-Consortium organization no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @phil-blain. We could use ssh, but I'm not sure it's worth setting up the ssh keys for occasional testing. Putting in a username and password doesn't seem like a large burden or hurdle.

I have given a few people access to the test_cice_icepack repo. You should be able to push to that repo using your own username/password. Or are you suggesting that the "organization" name be a variable? My idea is that a handful of us will have access to the repo under "apcraig", and we'll use it for now. I don't see any value in setting up the equivalent repo under multiple users. If we did that, we'd end up needing to test/change a few other things including the codecov location and the token string that connects github and codecov. It seems just easier to give a subset of folks write access to my test_cice_icepack repo. It's just a temporary repo and if it's get trashed, it's not a big deal. Every use basically removes all files and adds them all back again anyway.

I replied in #89 that I would prefer to keep the test_cice_icepack repo hidden and out of the CICE-Consortium. My hope is that it's temporary (until codecov supports submodules although I don't have a lot of optimism), and I prefer the fake repo not be visible to the community in general, especially since it's not part of the standard workflow and testing. I think it can only create confusion in the community. It would be easy to migrate test_cice_icepack to the consortium org if others felt it was better there though.

cd test_cice_icepack.${date}
git rm -r *
cp -p -r ../cice.master.${date}/* .

# Manually copy missed files if needed (should be just dot files, do not copy in .gitmodules)
diff -r ../cice.master.${date} . --exclude .git
cp as needed

# Clean up icepack .git stuff and Commit
rm -r -f icepack/.git*
git add .
git commit -m "update test_cice_icepack master to ${hash}"

# Push test_cice_icepack
git push origin master

# Run test suite
./cice.setup --suite first_suite,base_suite,travis_suite,decomp_suite,reprosum_suite,quick_suite -m gordon -e gnu --testid T${date} --codecov --queue standard

28 changes: 21 additions & 7 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -675,19 +675,33 @@ repository has to be created to test CICE with Icepack integrated directly. The
https://github.com/apcraig/Test_CICE_Icepack serves as the current default test repository.
In general, to setup the code coverage test in CICE, the current CICE master has
to be copied into the Test_CICE_Icepack repository, then the code coverage tool can
be run on that repository. A sample script to do that would be::
be run on that repository. A sample process to do that would be::

git clone https://github.com/cice-consortium/cice cice.master --recursive
# Check out current cice master
git clone https://github.com/cice-consortium/cice cice.master.${date} --recursive
cd cice.master.${date}
set hash = `git show --oneline -s | cut -f 1 -d " "`
cd ../

git clone https://github.com/apcraig/test_cice_icepack
cd test_cice_icepack
# Check out test_cice_icepack and update from cice master
git clone https://github.com/apcraig/test_cice_icepack test_cice_icepack.${date}
cd test_cice_icepack.${date}
git rm -r *
cp -p -r ../cice.master/* .
cp -p -r ../cice.master.${date}/* .
diff -r ../cice.master.${date} . --exclude .git
# Manually copy files if needed (should be just dot files, do not copy in .gitmodules)
rm -r -f icepack/.git*
git add .
git commit -m "update to current cice master"
git commit -m "update test_cice_icepack master to ${hash}"

# Push test_cice_icepack
git push origin master

./cice.setup --suite first_suite,base_suite,travis_suite,decomp_suite,reprosum_suite,quick_suite -m gordon -e gnu --codecov --testid cc01
# Run test suite
./cice.setup --suite first_suite,base_suite,travis_suite,decomp_suite,reprosum_suite,quick_suite -m gordon -e gnu --testid T${date} --codecov --queue standard

There is also a script in **configuration/scripts/tests/cice_test_codecov.csh** that
provides similar information.

To use, submit a full test suite using an updated Test_CICE_Icepack version
and the gnu compiler with the ``--codecov`` argument.
Expand Down