Skip to content

Commit

Permalink
Merge branch 'mitchell/dx-2286-2' into DX-2224
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Oct 30, 2023
2 parents 727d151 + 6132cbe commit fb9374a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 24 deletions.
4 changes: 2 additions & 2 deletions internal/runbits/requirements/requirements.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(requirementName, requ
switch nsType {
case model.NamespacePackage, model.NamespaceBundle:
commitID, err := localcommit.Get(r.Project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}

Expand Down Expand Up @@ -191,7 +191,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(requirementName, requ
}

parentCommitID, err := localcommit.Get(r.Project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}
hasParentCommit := parentCommitID != ""
Expand Down
4 changes: 2 additions & 2 deletions internal/runners/pull/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (p *Pull) Run(params *PullParams) error {

var localCommit *strfmt.UUID
localCommitID, err := localcommit.Get(p.project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}
if localCommitID != "" {
Expand Down Expand Up @@ -151,7 +151,7 @@ func (p *Pull) Run(params *PullParams) error {
}

commitID, err := localcommit.Get(p.project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/runners/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (r *Push) verifyInput() error {
}

commitID, err := localcommit.Get(r.project.Dir())
if err != nil && !localcommit.IsFileDoesNotExistError(err) {
if err != nil {
return errs.Wrap(err, "Unable to get local commit")
}
if commitID == "" {
Expand Down
5 changes: 5 additions & 0 deletions test/integration/package_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ func (suite *PackageIntegrationTestSuite) TestJSON() {
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)

cp = ts.Spawn("checkout", "ActiveState-CLI/Perl-5.32", ".")
cp.Expect("Skipping runtime setup")
cp.Expect("Checked out project")
cp.ExpectExitCode(0)

cp = ts.SpawnWithOpts(
e2e.OptArgs("checkout", "ActiveState-CLI/Packages-Perl", "."),
)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/pull_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (suite *PullIntegrationTestSuite) TestPull() {
ts := e2e.New(suite.T(), false)
defer ts.Close()

ts.PrepareProject("ActiveState-CLI/Python3", "")
ts.PrepareProject("ActiveState-CLI/Python3", "59404293-e5a9-4fd0-8843-77cd4761b5b5")

cp := ts.Spawn("pull")
cp.Expect("Operating on project")
Expand Down
18 changes: 0 additions & 18 deletions test/integration/push_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,24 +264,6 @@ func (suite *PushIntegrationTestSuite) TestPush_NoChanges() {
}
}

func (suite *PushIntegrationTestSuite) TestPush_NoCommit() {
suite.OnlyRunForTags(tagsuite.Push)

ts := e2e.New(suite.T(), false)
defer ts.Close()

ts.PrepareProject("ActiveState-CLI/cli", "")

ts.LoginAsPersistentUser()
cp := ts.SpawnWithOpts(e2e.OptArgs("push"))
cp.Expect("nothing to push")
cp.ExpectExitCode(1)

if strings.Count(cp.Snapshot(), " x ") != 1 {
suite.Fail("Expected exactly ONE error message, got: ", cp.Snapshot())
}
}

func (suite *PushIntegrationTestSuite) TestPush_NameInUse() {
suite.OnlyRunForTags(tagsuite.Push)

Expand Down

0 comments on commit fb9374a

Please sign in to comment.