dimchris / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

Split test code from library and merge with test data #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In order to reduce the number of binary packages (Issue 83) it makes more sense 
to merge test cases with the test data. At the same time we still want test 
cases to be committed together with the code changes.

Therefore we will reorganise the layout of the repository to look something 
like this:

   /mdanalysis
              /package
              /tests

where package will contain the current trunk without MDAnalysis/tests and tests 
will contain MDAnalysis/tests together with the test data.

Because git is much better at handling these kind of splitting/merging 
operations we will do this once the repository has been gittified (Issue 86).

Original issue reported on code.google.com by orbeckst on 19 Nov 2011 at 4:00

GoogleCodeExporter commented 9 years ago
(If anyone else feels they would like to do this please grab the ticket!)

Original comment by orbeckst on 19 Nov 2011 at 4:06

GoogleCodeExporter commented 9 years ago

Original comment by orbeckst on 6 Dec 2011 at 6:18

GoogleCodeExporter commented 9 years ago
I'm looking for suggestions on some git magic to create the new layout as per 
the first comment.

My idea was to
1. somehow merge testdata back into master
2. git mv files into separate directories

The plan is flawed, though: Just merging replays all the deletions that were 
used to split the test data from the code in the first place.

What I have at the moment strikes me as rather un-elegant (and it looses 
history):
1. git mv master-stuff package
2. git checkout testdata MDAnalysisTestData  # just gets the files but they 
appear as "new" -- looses history
3. git mv stuff around...

Any suggestions how to use git to merge the testdata back into master? 
Cherry-picking?

Thanks,
Oli

Original comment by orbeckst on 19 Dec 2011 at 2:03

GoogleCodeExporter commented 9 years ago
Ok, I just played a little with git (and google) and here is what I think 
should work as needed:

Prepare the master branch:
1. git checkout master
2. git mv stuff into package dir
3. git commit

Prepare the testdata branch
1'. git checkout testdata
2'. git mv stuff into tests dir
3'. git commit

And then do the merge:
4. git checkout master
5. git merge --squash -s resolve testdata
6. Check that everything is OK
7. git commit

The "--squash" if just to stop the merge process before committing.
The trick is using "-s resolve" when performing the merge: I tried this locally 
and everything went smoothly without any conflict nor history loss.
Git is really awesome!

Original comment by sebastie...@gmail.com on 20 Dec 2011 at 10:34

GoogleCodeExporter commented 9 years ago
Thanks, Séb, that was some good git-voodoo.

I renamed the tests directory to testsuite and did various adjustments. See 
comments for commit 30e21da161. Seems to work but feedback is most welcome.

The wiki and other docs needs to be updated. If anyone finds anything that is 
obviously wrong please correct as needed. Thanks.

Oli

Original comment by orbeckst on 21 Dec 2011 at 10:20