Hackpads are smart collaborative documents. .

Shaurya Sengar

478 days ago
Unfiled. Edited by Shaurya Sengar 478 days ago
Tracking branch material (useful for understanding the concepts)
 
The current implementation uses git-rev-list, which lists commits that are reachable by following the parent links from the given commit(s), but excludes commits that are reachable from the one(s) given with a ^ in front of them.
 
Shaurya S Below is a more detailed explanation -
 
Relevant code snippet (implements the algorithm explained above) -
 
 
git-rev-list configuration options -
 
You can think of 'git-rev-list' as a set operation. Commits given on the command line form a set of commits that are reachable from any of them, and then commits reachable from any of the ones given with ^in front are subtracted from that set. The remaining commits are what comes out in the command’s output. 
 
478 days ago
Unfiled. Edited by Shaurya Sengar 478 days ago
Shaurya S Tests that have been written (from project description)-
  • Calling delete_branch() with and without the merged_only flag set, ensuring that execute() is called with the right arguments (2 tests). You'll need to use a KGB function spy for this.
  • Calling create_commit() with the various possible arguments, ensuring that edit_text() is/isn't called (depending) and that execute() is called with the right arguments. Each unique condition should have a test.
  • Calling merge() with the various possible arguments. Similar to the above. You'll also need to simulate error conditions (which you can do with KGB), and check the resulting exception.
  • Calling push_upstream() with the various possible arguments, and checking the exceptions in certain cases.
 
Things actually tested to cover the tests outlined above (https://reviews.reviewboard.org/r/8099/) -
  • Wrote the following test cases for the following methods of the the GitClient class -
  •  
  • Method name - push_upstream() -
  • 1) Tested push_upstream() with an invalid target branch. The 'git_pull' must raise a PushError exception.
  • 2) Tested push_upstream() with the push_url set to be an invalid one. Neither the 'pull' or the 'push' must raise an exception because it gets it's origin_url from the Git config which still has a valid fetch_url
  •  
  • Method name - merge()
  • 1) Tested merge() with invalid target and destination branches. Both of these must raise a MergeError exception
  • 2) Tested merge() with squash set to True and False. Used a KGB spy to check if execute was called with the right arguments.
  •  
  • Method name - create_commit()
  • 1) Tested create_commit() with run_editor set to True and False. Used a KGB spy to check if edit_text was called or not.
  • 2) Tested create_commit() with all_files set to True and False. Used a KGB spy to check if execute was called with the right arguments.
  •  
  • Method name - delete_branch()
  • 1) Tested delete_branch() with merged_only set to True and False. Used a KGB spy to check if execute was called with the right arguments.
 
Tests that need to be written (from project description)
  • Calling scan_for_server() with a git-svn repository that has a reviewboard:url property on the root of the repository. (You'd need to set this on the SVN repository we have stored inrbtools/clients/testdata/svn-repo), and make sure the result matches.
  • Calling make_diff() against a git-svn repository.
  • Calling make_diff() against a git-p4 repository.
 
 

Contact Support



Please check out our How-to Guide and FAQ first to see if your question is already answered! :)

If you have a feature request, please add it to this pad. Thanks!


Log in