On Thu, Aug 20, 2015 at 7:36 PM, Leo Arias <email address hidden> wrote:
> Leo Arias has proposed merging lp:~elopio/snappy-tests-job/get_branch into > lp:~fgimenez/snappy-tests-job/trunk. > > Commit message: > Renamed Run to Get in the source interface. >
A rationale here would be good.
> > Requested reviews: > Snappy Developers (snappy-dev) > > For more details, see: > > https://code.launchpad.net/~elopio/snappy-tests-job/get_branch/+merge/268687 > > 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. > -- > Your team Snappy Developers is requested to review the proposed merge of > lp:~elopio/snappy-tests-job/get_branch into > lp:~fgimenez/snappy-tests-job/trunk. > > Launchpad-Message-Rationale: Reviewer @snappy-dev > Launchpad-Notification-Type: code-review > Launchpad-Branch: ~elopio/snappy-tests-job/get_branch > Launchpad-Project: snappy-tests-job > > === modified file 'snappy-tests-job/main.go' > --- snappy-tests-job/main.go 2015-08-13 15:56:06 +0000 > +++ snappy-tests-job/main.go 2015-08-21 02:35:42 +0000 > @@ -68,7 +68,7 @@ > // TODO: we need a waitGroup here to run things more efficiently > utilHandler := utils.NewBasicHandler() > sourceHandler := source.NewBzrHandler(utilHandler) > - sourcePath, err := sourceHandler.Run(*src) > + sourcePath, err := sourceHandler.Get(*src) > if err != nil { > log.Panicf("Error getting %s into %s", *src, sourcePath) > } > > === modified file 'source/source.go' > --- source/source.go 2015-07-24 15:28:01 +0000 > +++ source/source.go 2015-08-21 02:35:42 +0000 > @@ -36,7 +36,7 @@ > > // Sourcer is the interface satisfied by all the source handlers > type Sourcer interface { > - Run(string) (string, error) > + Get(string) (string, error) > } > > // BzrHandler is a source handler for bazaar > @@ -44,8 +44,8 @@ > util utils.Utilizer > } > > -// Run is the method for getting the source code > -func (handler *BzrHandler) Run(repo string) (string, error) { > +// Get is the method for getting the source code > +func (handler *BzrHandler) Get(repo string) (string, error) { > path := filepath.Join(targetPath, strconv.Itoa(os.Getpid()), > basePkg) > > log.Printf("*** Branching %s in %s ***", repo, path) > > === modified file 'source/source_test.go' > --- source/source_test.go 2015-07-24 09:59:38 +0000 > +++ source/source_test.go 2015-08-21 02:35:42 +0000 > @@ -54,8 +54,8 @@ > check.Commentf("Expected type Sourcer, got %T", s.subject)) > } > > -func (s *sourceSuite) TestRunCreatesTargetPath(c *check.C) { > - s.subject.Run(testRepo) > +func (s *sourceSuite) TestGetCreatesTargetPath(c *check.C) { > + s.subject.Get(testRepo) > > expected := expectedBasePath() > > @@ -63,26 +63,26 @@ > check.Commentf("The target directory %s was not created", > expected)) > } > > -func (s *sourceSuite) TestRunCallsBranchCommand(c *check.C) { > - s.subject.Run(testRepo) > +func (s *sourceSuite) TestGetCallsBranchCommand(c *check.C) { > + s.subject.Get(testRepo) > > pullCmd := pullCmd() > c.Assert(s.fakeUtil.ExecCalls[pullCmd], check.Equals, 1, > check.Commentf("The pull command %s was not called", > pullCmd)) > } > > -func (s *sourceSuite) TestRunReturnValue(c *check.C) { > - path, err := s.subject.Run(testRepo) > +func (s *sourceSuite) TestGetReturnValue(c *check.C) { > + path, err := s.subject.Get(testRepo) > expected := expectedReturnPath() > > c.Assert(path, check.Equals, expected, check.Commentf("Unexpected > return value path %s", path)) > c.Assert(err, check.IsNil, check.Commentf("Unexpected return error > %s", err)) > } > > -func (s *sourceSuite) TestRunDoesNotCallBranchCommandOnError(c *check.C) { > +func (s *sourceSuite) TestGetDoesNotCallBranchCommandOnError(c *check.C) { > s.fakeUtil.FailMkDir = true > > - s.subject.Run(testRepo) > + s.subject.Get(testRepo) > > pullCmd := pullCmd() > c.Assert(s.fakeUtil.ExecCalls[pullCmd], check.Equals, 0, > > >
« Back to merge proposal
On Thu, Aug 20, 2015 at 7:36 PM, Leo Arias <email address hidden> wrote:
> Leo Arias has proposed merging lp:~elopio/snappy-tests-job/get_branch into
> lp:~fgimenez/snappy-tests-job/trunk.
>
> Commit message:
> Renamed Run to Get in the source interface.
>
A rationale here would be good.
> /code.launchpad .net/~elopio/ snappy- tests-job/ get_branch/ +merge/ 268687 Message- Rationale: Reviewer @snappy-dev Notification- Type: code-review snappy- tests-job/ get_branch tests-job/ main.go' tests-job/ main.go 2015-08-13 15:56:06 +0000 tests-job/ main.go 2015-08-21 02:35:42 +0000 andler( ) NewBzrHandler( utilHandler) Run(*src) Get(*src) Join(targetPath , strconv. Itoa(os. Getpid( )), source_ test.go' source_ test.go 2015-07-24 09:59:38 +0000 source_ test.go 2015-08-21 02:35:42 +0000 "Expected type Sourcer, got %T", s.subject)) argetPath( c *check.C) { Run(testRepo) argetPath( c *check.C) { Get(testRepo) nchCommand( c *check.C) { Run(testRepo) nchCommand( c *check.C) { Get(testRepo) s.fakeUtil. ExecCalls[ pullCmd] , check.Equals, 1, lue(c *check.C) { Run(testRepo) lue(c *check.C) { Get(testRepo) ath() "Unexpected "Unexpected return error allBranchComman dOnError( c *check.C) { allBranchComman dOnError( c *check.C) { FailMkDir = true Run(testRepo) Get(testRepo) s.fakeUtil. ExecCalls[ pullCmd] , check.Equals, 0,
> Requested reviews:
> Snappy Developers (snappy-dev)
>
> For more details, see:
>
> https:/
>
> 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.
> --
> Your team Snappy Developers is requested to review the proposed merge of
> lp:~elopio/snappy-tests-job/get_branch into
> lp:~fgimenez/snappy-tests-job/trunk.
>
> Launchpad-
> Launchpad-
> Launchpad-Branch: ~elopio/
> Launchpad-Project: snappy-tests-job
>
> === modified file 'snappy-
> --- snappy-
> +++ snappy-
> @@ -68,7 +68,7 @@
> // TODO: we need a waitGroup here to run things more efficiently
> utilHandler := utils.NewBasicH
> sourceHandler := source.
> - sourcePath, err := sourceHandler.
> + sourcePath, err := sourceHandler.
> if err != nil {
> log.Panicf("Error getting %s into %s", *src, sourcePath)
> }
>
> === modified file 'source/source.go'
> --- source/source.go 2015-07-24 15:28:01 +0000
> +++ source/source.go 2015-08-21 02:35:42 +0000
> @@ -36,7 +36,7 @@
>
> // Sourcer is the interface satisfied by all the source handlers
> type Sourcer interface {
> - Run(string) (string, error)
> + Get(string) (string, error)
> }
>
> // BzrHandler is a source handler for bazaar
> @@ -44,8 +44,8 @@
> util utils.Utilizer
> }
>
> -// Run is the method for getting the source code
> -func (handler *BzrHandler) Run(repo string) (string, error) {
> +// Get is the method for getting the source code
> +func (handler *BzrHandler) Get(repo string) (string, error) {
> path := filepath.
> basePkg)
>
> log.Printf("*** Branching %s in %s ***", repo, path)
>
> === modified file 'source/
> --- source/
> +++ source/
> @@ -54,8 +54,8 @@
> check.Commentf(
> }
>
> -func (s *sourceSuite) TestRunCreatesT
> - s.subject.
> +func (s *sourceSuite) TestGetCreatesT
> + s.subject.
>
> expected := expectedBasePath()
>
> @@ -63,26 +63,26 @@
> check.Commentf("The target directory %s was not created",
> expected))
> }
>
> -func (s *sourceSuite) TestRunCallsBra
> - s.subject.
> +func (s *sourceSuite) TestGetCallsBra
> + s.subject.
>
> pullCmd := pullCmd()
> c.Assert(
> check.Commentf("The pull command %s was not called",
> pullCmd))
> }
>
> -func (s *sourceSuite) TestRunReturnVa
> - path, err := s.subject.
> +func (s *sourceSuite) TestGetReturnVa
> + path, err := s.subject.
> expected := expectedReturnP
>
> c.Assert(path, check.Equals, expected, check.Commentf(
> return value path %s", path))
> c.Assert(err, check.IsNil, check.Commentf(
> %s", err))
> }
>
> -func (s *sourceSuite) TestRunDoesNotC
> +func (s *sourceSuite) TestGetDoesNotC
> s.fakeUtil.
>
> - s.subject.
> + s.subject.
>
> pullCmd := pullCmd()
> c.Assert(
>
>
>