-
Notifications
You must be signed in to change notification settings - Fork 132
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @apcraig, I'm SO GLAD your've gotten this working. Considering our effort to reduce redundancy, what is the purpose of having the scripting commands both in the documentation and in the script itself? If I understand correctly, the script can't be run as a script. Is that true?
@eclare108213, you are right that the documentation and script are redundant. I was undecided about which approach to take so did both, but I knew this would not be ideal. Especially as I have been a proponent of reducing redundancy. I have removed the script again, and think the documentation is more than adequate at this point. The other option would be to leave the script but have the documentation point to it. If anyone feels this is a better option, let me know. Thanks! |
Yes, thanks for the chuckle. If the script can't actually be run as it is, then it's probably better not to have it as a script. If it can be fixed to run without manual intervention, then I'd recommend keeping the script and pointing the documentation to it. My $0.02. |
OK, I just updated things again. I have added a working script and removed the redundant documentation. There were some challenges with the script, but I think reasonable compromises have been made. You have to run the script interactively because it will ask for git login information when you push to the test_cice_icepack repository. Once this PR is merged, I will coordinate testing with others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, some of the rest of us ought to try to do this, but it sounds like this PR is an interim step, getting there.
# This also copies in all dot file at the root that do not start with .g (ie. .git*) | ||
echo " " | ||
echo "*** checkout current test_cice_master ***" | ||
git clone https://github.com/apcraig/test_cice_icepack test_cice_icepack.${date} |
There was a problem hiding this comment.
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 (git@github.com: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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
Co-Authored-By: Philippe Blain <levraiphilippeblain@gmail.com>
Also, I'm not convinced we need a separate repository for the coverage to work with icepack. We could maintain a separate branch in CICE-Consortium/CICE, call it something like Something like this would work to initially create the branch (first time setup) : # Create the branch from `master`
git checkout --recurse-submodules -b codecov master
# Remove icepack as a submodule, but add it back as a directory
mv icepack/ icepack-cp && \ # keep a copy of the files
git submodule deinit icepack && \ # deinit the submodule
git rm icepack && \ # remove the submodule and stage the removal
mv icepack-cp icepack && \ # put the files back in place
rm icepack/.git && \ # remove the gitfile
git add icepack && \ # stage the files
git commit -m "codecov: create branch from $(git rev-parse --short master)" Then, when we want to update the # checkout the `codecov` branch
git checkout --recurse-submodules -f codecov
# prepare to create a merge, do not commit yet, and keep all files as-is
git merge -s ours --no-commit master
# overwrite all files with the content of `master`, recursively in submodules
git read-tree -m -u --recurse-submodules master
# Remove icepack as a submodule, but add it back as a directory
mv icepack/ icepack-cp && \ # keep a copy of the files
git submodule deinit icepack && \ # deinit the submodule
git rm -f icepack && \ # (force) remove the submodule and stage the removal
mv icepack-cp icepack && \ # put the files back in place
rm icepack/.git && \ # remove the gitfile
git add icepack && \ # stage the files
git commit -m "codecov: merge master at $(git rev-parse --short master)" This would create a history looking like this:
Note that the history of |
Thanks @phil-blain, lots of good ideas. What I've implemented is certainly not the most sophisticated, partly because of my knowledge of git and partly because of my tendency to be a little more conservative in my approach. But I did consider a number of approaches. One approach I considered was to checkout CICE, remove the icepack submodule piece (similar to what you outline above with deinit) and push directly to test_cice_icepack. I viewed this as more risky than checking out test_cice_icepack and then copying in the latest files simply because of the definition of "origin" and the risk that you push to origin accidently if you are working in a CICE sandbox. What is proposed above is similar to my rejected option but we would now be pushing directly to the CICE branch. I view this approach as even more risky than the option I rejected. This latest proposal requires that changes be pushed directly into the CICE repository without benefit of a PR. We will also create a branch in CICE that will be fundamentally different than master in terms of the submodule. I think this could be confusing to users. Finally, only a very limited number of people have write access to the CICE repository. By actually leveraging a separate repository, we can allow more people to contribute to the code coverage testing. Finally, I don't think the history of the test_cice_icepack repo/branch is critical. It's nice to know what version of CICE it's aligned to, and I admit that tracking the history of CICE in test_cice_icepack better would be helpful. But I still view this tool as something that is run occasionally (a few times a year), and the main thing is that when we test, we're testing the current CICE code. If we decide we want to automate the code coverage testing and run it weekly (for instance), then a different approach might be appropriate. I am certainly open to other approaches. I also understand that I tend to be fairly conservative about these things and am happy to move in a different direction. I guess I would argue that we should see whether what we have now is useful, working, and robust. We should use the information from the code coverage tool to improve our test coverage over the next several months. And we should continue to periodically run code coverage test manually to reassess the situation. The current implementation is relatively straight-forward to carry out, largely hidden from the community, and is easy to drop if it turns out to be less useful than we hoped. If we gain experience and decide we do want automated weekly testing or need to update the implementation for other reasons, then we can certainly do that in the future. Anyway, that's what I propose at this point, but as I said, I'm open to other ideas. |
PR checklist
Update code coverage documentation
apcraig
No testing done, this diff just updates documentation and adds a reference script
Testing of the latest code coverage changes looks good. This PR just updates the documentation for carrying the testing out. In particular, creation of the special test_cice_icepack repository.
Over the next week or two, I'll work with @rallard77 (if willing) to make sure the process works for other consortium members.
Finally, a separate task is to review the coverage reports and improve testing.