Merge lp:~elopio/snappy-tests-job/get_branch into lp:~fgimenez/snappy-tests-job/trunk

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/snappy-tests-job/get_branch
Merge into: lp:~fgimenez/snappy-tests-job/trunk
Diff against target: 84 lines (+12/-12)
3 files modified
snappy-tests-job/main.go (+1/-1)
source/source.go (+3/-3)
source/source_test.go (+8/-8)
To merge this branch: bzr merge lp:~elopio/snappy-tests-job/get_branch
Reviewer Review Type Date Requested Status
Snappy Developers Pending
Review via email: mp+268686@code.launchpad.net

This proposal has been superseded by a proposal from 2015-08-21.

Commit message

Renamed Run to Get in the source interface.

Description of the change

I'm adding a Merge func to the interface, and I thought that Run is not as accurate as Get. So I'm renaming it here.

To post a comment you must log in.

Unmerged revisions

62. By Leo Arias

Updated the call to source.Get in main.

61. By Leo Arias

Renamed Run to Get in source.go.

60. By Leo Arias

Renamed Run to Get in the source_tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy-tests-job/main.go'
2--- snappy-tests-job/main.go 2015-08-13 15:56:06 +0000
3+++ snappy-tests-job/main.go 2015-08-21 02:27:54 +0000
4@@ -68,7 +68,7 @@
5 // TODO: we need a waitGroup here to run things more efficiently
6 utilHandler := utils.NewBasicHandler()
7 sourceHandler := source.NewBzrHandler(utilHandler)
8- sourcePath, err := sourceHandler.Run(*src)
9+ sourcePath, err := sourceHandler.Get(*src)
10 if err != nil {
11 log.Panicf("Error getting %s into %s", *src, sourcePath)
12 }
13
14=== modified file 'source/source.go'
15--- source/source.go 2015-07-24 15:28:01 +0000
16+++ source/source.go 2015-08-21 02:27:54 +0000
17@@ -36,7 +36,7 @@
18
19 // Sourcer is the interface satisfied by all the source handlers
20 type Sourcer interface {
21- Run(string) (string, error)
22+ Get(string) (string, error)
23 }
24
25 // BzrHandler is a source handler for bazaar
26@@ -44,8 +44,8 @@
27 util utils.Utilizer
28 }
29
30-// Run is the method for getting the source code
31-func (handler *BzrHandler) Run(repo string) (string, error) {
32+// Get is the method for getting the source code
33+func (handler *BzrHandler) Get(repo string) (string, error) {
34 path := filepath.Join(targetPath, strconv.Itoa(os.Getpid()), basePkg)
35
36 log.Printf("*** Branching %s in %s ***", repo, path)
37
38=== modified file 'source/source_test.go'
39--- source/source_test.go 2015-07-24 09:59:38 +0000
40+++ source/source_test.go 2015-08-21 02:27:54 +0000
41@@ -54,8 +54,8 @@
42 check.Commentf("Expected type Sourcer, got %T", s.subject))
43 }
44
45-func (s *sourceSuite) TestRunCreatesTargetPath(c *check.C) {
46- s.subject.Run(testRepo)
47+func (s *sourceSuite) TestGetCreatesTargetPath(c *check.C) {
48+ s.subject.Get(testRepo)
49
50 expected := expectedBasePath()
51
52@@ -63,26 +63,26 @@
53 check.Commentf("The target directory %s was not created", expected))
54 }
55
56-func (s *sourceSuite) TestRunCallsBranchCommand(c *check.C) {
57- s.subject.Run(testRepo)
58+func (s *sourceSuite) TestGetCallsBranchCommand(c *check.C) {
59+ s.subject.Get(testRepo)
60
61 pullCmd := pullCmd()
62 c.Assert(s.fakeUtil.ExecCalls[pullCmd], check.Equals, 1,
63 check.Commentf("The pull command %s was not called", pullCmd))
64 }
65
66-func (s *sourceSuite) TestRunReturnValue(c *check.C) {
67- path, err := s.subject.Run(testRepo)
68+func (s *sourceSuite) TestGetReturnValue(c *check.C) {
69+ path, err := s.subject.Get(testRepo)
70 expected := expectedReturnPath()
71
72 c.Assert(path, check.Equals, expected, check.Commentf("Unexpected return value path %s", path))
73 c.Assert(err, check.IsNil, check.Commentf("Unexpected return error %s", err))
74 }
75
76-func (s *sourceSuite) TestRunDoesNotCallBranchCommandOnError(c *check.C) {
77+func (s *sourceSuite) TestGetDoesNotCallBranchCommandOnError(c *check.C) {
78 s.fakeUtil.FailMkDir = true
79
80- s.subject.Run(testRepo)
81+ s.subject.Get(testRepo)
82
83 pullCmd := pullCmd()
84 c.Assert(s.fakeUtil.ExecCalls[pullCmd], check.Equals, 0,

Subscribers

People subscribed via source and target branches

to all changes: