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

278 improve ctest s git commands #279

Conversation

bartlettroscoe
Copy link
Member

Addresses #278

See commits for details.

This allows cloning the TriBITS repo and submitting to CDash.
This is a start but these really need to be converted into README.md files and
make more complete.
…tronger testing (TriBITSPub#278, TRIL-260)

This commit represents a fairly significant enhancement of the handing of git
repo clones and updates.  Previous to this commit, CDash would not report the
correct git repo SHA1 if the branch was not the default branch on the initial
clone or in checking out a new branch.  Also, the git commands were not robust
in use cases where the current branch in a base repo or an extra repo was not
on a tracking branch or the branch in the remote repo did not exist (like
occurred in TRIL-260 which changing from 'atdm-develop-nightly' to
'atdm-nightly' where 'atdm-develop-nightly' got deleted in the GitHub repo).
The documentation for git repo updates and been improved and streamlined.

This includes a huge step forward in automated testing of the
tribits_ctest_driver() function in how it does real git repo clones and
updates for various use cases.  To accomplish this, a new set of repos were
create under https://github.com/tribits/ for the example projects/repos
TribitsExampleMetaProject, TribitsExampleProject and
TribitsExampleProjectAddons.  There is a branch 'for-testing' in each of those
repos that have known stats that are used for strong testing.  Tests are set
up based on a base TribitsExampleMetaProject repo/project that clones the
extra repos TribitsExampleProject and TribitsExampleProjectAddons so we cover
use cases in the base repo and extra repos (which are mostly decoupled).  This
testing helped to catch invalid logic for the extra repos (for the case where
the current branch is not a tracking branch).

Some of the specific things done include:

* Switched from CTEST_UPDATE_COMMAND to CTEST_GIT_COMMAND (this really is git
  only)

* Added CTEST_GIT_UPDATE_CUSTOM which calls a ctest -P script to do the
  improved git repo cleanup and update commands (see updated documentation).

* Allow a set of CTEST_NOTES_FILES be specified by the user and correctly
  added to other notes files created internally and (hopefully) submitted to
  CDash.  There are now strong unit tests for the full listing of notes files
  that are generated (which requires running ctest_update() to generate a few
  of the files).

* Added TRIBITS_READ_CTEST_TAG_FILE() and TribitsGetCTestTestXmlDir.cmake
  (TriBITSPub#278, TriBITSPub#154): This is needed to be able to read XML files out of the
  <bulid>/Testing/<buildstarttime>/ directory needed for (TriBITSPub#278).  This will
  also make it easy to generate a CDash URL without knowing the build ID.  But
  this is not hooked in yet.  It was added here with the hope to check the
  contents of the Notes.xml file but that file does not get generated unless
  you actually submit to CDash (which we can't do yet and don't want to rely
  on).  Also added the file Add list_cdash_notes_files_in_xml_file.sh in hopes
  of doing this testing.

* Remove the function to get the extra repo tracking branch.  The old code
  assumed that the current branch in an extra repo was on a tacking branch.
  That is a bad assumption.  The updated code just uses '@{u}' as the tracking
  branch.  This was a real defect that was found through careful automated
  testing with real git commands.  This is why we need some tests with real
  git commands to validate our implementation.

* Updated some files in the example repos TribitsExampleMetaProject,
  TribitsExampleProject and TribitsExampleProjectAddons some to get these
  testing use cases working.  Also improved the README files some more, but
  more is needed.
@bartlettroscoe bartlettroscoe changed the base branch from 278-improve-ctest-s-git-commands to master February 20, 2019 12:20
@bartlettroscoe bartlettroscoe self-assigned this Feb 20, 2019
@bartlettroscoe bartlettroscoe merged commit 76e958d into TriBITSPub:master Feb 20, 2019
@bartlettroscoe
Copy link
Member Author

@fryeguy52,

This PR has been merged, but can you please review at least the updated documentation at:

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant