MantisBT - CMake
View Issue Details
0006994CMakeCMakepublic2008-05-09 08:392009-12-16 14:29
Andreas Schneider. 
Brad King 
normalfeatureN/A
closedfixed 
CMake-2-6 
 
0006994: Add git support to CTest
Please add git support to CTest.
No tags attached.
related to 0006857closed Brad King CMake Feature request: More UPDATE_TYPE (e.g. bzr) in CTest 
child of 0007541new  CDash support modern version-control tools 
Issue History
2008-05-09 08:39Andreas Schneider.New Issue
2008-05-09 08:50Bill HoffmanNote Added: 0011770
2008-05-09 08:50Bill HoffmanStatusnew => assigned
2008-05-09 08:50Bill HoffmanAssigned To => Brad King
2008-05-12 17:01Brad KingNote Added: 0011833
2008-08-19 14:35Brad KingRelationship addedrelated to 0006269
2008-08-19 14:35Brad KingRelationship deletedrelated to 0006269
2008-08-19 14:36Brad KingRelationship addedrelated to 0006857
2008-08-25 15:38Brad KingRelationship addedrelated to 0007541
2009-04-22 09:20Brad KingNote Added: 0016129
2009-04-22 09:30Brad KingNote Added: 0016130
2009-04-22 10:19Andreas Schneider.Note Added: 0016133
2009-04-22 10:33Brad KingNote Added: 0016134
2009-04-22 10:44Andreas Schneider.Note Added: 0016135
2009-04-22 10:52Andreas Schneider.Note Edited: 0016135
2009-06-29 09:47Brad KingRelationship addedparent of 0007879
2009-06-29 09:48Brad KingRelationship deletedparent of 0007879
2009-06-29 09:52Brad KingRelationship addedrelated to 0007879
2009-07-10 11:20Brad KingRelationship replacedchild of 0007541
2009-07-10 11:22Brad KingRelationship deletedrelated to 0007879
2009-12-16 14:29Brad KingNote Added: 0018928
2009-12-16 14:29Brad KingStatusassigned => closed
2009-12-16 14:29Brad KingResolutionopen => fixed

Notes
(0011770)
Bill Hoffman   
2008-05-09 08:50   
Brad is this possible?
(0011833)
Brad King   
2008-05-12 17:01   
Bill: Yes, but presenting the results nicely will require new CDash work. I do not think it is worth doing anything on the CTest side until that can be done.

GlaDiaC: Meanwhile, you can use new-style CTest scripts (the ones with explicit CTEST_START, CTEST_UPDATE, CTEST_CONFIGURE, ... command calls) to run dashboards. Just replace the CTEST_UPDATE command call with an EXECUTE_PROCESS that runs "git pull". You won't get any update column on the dashboard or support for a nightly start time but at least you can run one.
(0016129)
Brad King   
2009-04-22 09:20   
I've committed basic CTest support for Git to CMake HEAD in CVS.

ENH: Factor global-VC parts out of cmCTestSVN
/cvsroot/CMake/CMake/Source/CMakeLists.txt,v <-- Source/CMakeLists.txt
new revision: 1.414; previous revision: 1.413
/cvsroot/CMake/CMake/Source/CTest/cmCTestGlobalVC.cxx,v <-- Source/CTest/cmCTestGlobalVC.cxx
initial revision: 1.1
/cvsroot/CMake/CMake/Source/CTest/cmCTestGlobalVC.h,v <-- Source/CTest/cmCTestGlobalVC.h
initial revision: 1.1
/cvsroot/CMake/CMake/Source/CTest/cmCTestSVN.cxx,v <-- Source/CTest/cmCTestSVN.cxx
new revision: 1.7; previous revision: 1.6
/cvsroot/CMake/CMake/Source/CTest/cmCTestSVN.h,v <-- Source/CTest/cmCTestSVN.h
new revision: 1.6; previous revision: 1.5

ENH: Teach CTest to handle git repositories
/cvsroot/CMake/CMake/Source/CMakeLists.txt,v <-- Source/CMakeLists.txt
new revision: 1.415; previous revision: 1.414
/cvsroot/CMake/CMake/Source/CTest/cmCTestGIT.cxx,v <-- Source/CTest/cmCTestGIT.cxx
initial revision: 1.1
/cvsroot/CMake/CMake/Source/CTest/cmCTestGIT.h,v <-- Source/CTest/cmCTestGIT.h
initial revision: 1.1
/cvsroot/CMake/CMake/Source/CTest/cmCTestUpdateCommand.cxx,v <-- Source/CTest/cmCTestUpdateCommand.cxx
new revision: 1.16; previous revision: 1.15
/cvsroot/CMake/CMake/Source/CTest/cmCTestUpdateHandler.cxx,v <-- Source/CTest/cmCTestUpdateHandler.cxx
new revision: 1.65; previous revision: 1.64
/cvsroot/CMake/CMake/Source/CTest/cmCTestUpdateHandler.h,v <-- Source/CTest/cmCTestUpdateHandler.h
new revision: 1.12; previous revision: 1.11
/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- Tests/CMakeLists.txt
new revision: 1.85; previous revision: 1.84
/cvsroot/CMake/CMake/Tests/CTestUpdateGIT.cmake.in,v <-- Tests/CTestUpdateGIT.cmake.in
initial revision: 1.1
(0016130)
Brad King   
2009-04-22 09:30   
The support I just committed does not honor the Nightly start time because doing so is tricky for git. In order to make sure all dashboard machines test the same version in Nightly mode, they need to update to the revision that was *published* as of the nightly start time on the server from which they pull. This needs to be the case even if someone pushes after the nightly start time to publish commits that are dated from before it.

I have untested/uncommitted changes to support the Nightly start time with the help of a server-side script (or at least a designated client with a cron job). The server reflog knows the revision published as of a given time, but there is no way to get it from a client, and for security reasons this cannot be added to git. Instead we need to provide a ref on the server of the form "nightly/<branch>/CCYY-MM-DD", where <branch> is the name of the branch tracked by dashboard clients, and CCYY-MM-DD is the date part of the nightly start time for that day. This ref must be created at the nightly start time using the current tip of <branch> using a cron job.

Comments or ideas, anyone?
(0016133)
Andreas Schneider.   
2009-04-22 10:19   
Doesn't 'git log --until=date' do what you're looking for?
(0016134)
Brad King   
2009-04-22 10:33   
No. This will give commits that were created before the nightly start time even if they were not pushed to the server until after it. Consider:

1.) I commit at 5pm locally but do not publish it.
2.) The nightly start time is 9pm
3.) At 9:01pm some dashboard machines start and update, but do not get my change
4.) At 10:00pm I decide to publish my commit, so I push.
5.) At 11:00pm other dashboard machines start and update, but get my change

Now some machines test without my changes and some test with them. The whole point of the nightly start time is to define a single revision to be tested for that day by all machines.

Instead, the above should proceed as follows.

1.) I commit at 5pm locally but do not publish it.
2.) At 9pm a cron job on the server does

      git update-ref -m "Nightly Stamp" refs/nightly/master/2009-04-21 refs/heads/master

    or

      git push . 'master:refs/nightly/master/2009-04-21'

3.) At 9:01pm some dashboard machines update to nightly/master/2009-04-21
4.) At 10:00pm I decide to publish my commit, so I push.
5.) At 11:00pm other dashboard machines update to nightly/master/2009-04-21

Now all machines use the same version.

The 'nightly' namespace of refs will move to packed-refs after a 'git gc',
and there will be a permanent record of the nightly versions.
(0016135)
Andreas Schneider.   
2009-04-22 10:44   
(edited on: 2009-04-22 10:52)
Ok, I understand. Your approach sounds good to me. I would suggest to ask on the git mailing if there is a better approach. Maybe they will implement something for automatic testing.

(0018928)
Brad King   
2009-12-16 14:29   
CTest 2.8.0 supports Git. See issue 0007541 for updates on the nightly start time issue (which affects all DVCS tools).