Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Naatan committed Oct 16, 2023
1 parent 105dda2 commit a019466
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion internal/runbits/requirements/rationalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (r *RequirementOperation) rationalizeError(err *error) {
// No matches, but have alternate suggestions
case errors.As(*err, &noMatchesErr) && noMatchesErr.Alternatives != nil:
*err = errs.WrapUserFacing(*err,
locale.Tr("package_ingredient_alternatives", tooManyMatchesErr.Query, *noMatchesErr.Alternatives),
locale.Tr("package_ingredient_alternatives", noMatchesErr.Query, *noMatchesErr.Alternatives),
errs.SetInput())

// We communicate buildplanner errors verbatim as the intend is that these are curated by the buildplanner
Expand Down
2 changes: 1 addition & 1 deletion test/integration/activate_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (suite *ActivateIntegrationTestSuite) TestActivatePythonByHostOnly() {
cp.ExpectNotExitCode(0)

if strings.Count(cp.Snapshot(), " x ") != 1 {
suite.Fail("Expected exactly ONE error message, got: %s", cp.Snapshot())
suite.Fail("Expected exactly ONE error message, got: ", cp.Snapshot())
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/checkout_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (suite *CheckoutIntegrationTestSuite) TestCheckoutNonEmptyDir() {
cp.ExpectExitCode(1)

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

// remove file
Expand Down Expand Up @@ -217,7 +217,7 @@ func (suite *CheckoutIntegrationTestSuite) TestCheckoutNotFound() {
cp.ExpectExitCode(1)

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

Expand Down
14 changes: 7 additions & 7 deletions test/integration/install_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (suite *InstallIntegrationTestSuite) TestInstall_InvalidCommit() {
cp.ExpectExitCode(1)

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

Expand All @@ -51,8 +51,8 @@ func (suite *InstallIntegrationTestSuite) TestInstall_NoMatches_NoAlternatives()
cp.Expect("find alternatives") // This verifies no alternatives were found
cp.ExpectExitCode(1)

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

Expand All @@ -67,8 +67,8 @@ func (suite *InstallIntegrationTestSuite) TestInstall_NoMatches_Alternatives() {
cp.Expect("did you mean") // This verifies alternatives were found
cp.ExpectExitCode(1)

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

Expand All @@ -82,8 +82,8 @@ func (suite *InstallIntegrationTestSuite) TestInstall_BuildPlannerError() {
cp.Expect("Could not plan build, platform responded with", e2e.RuntimeSourcingTimeoutOpt)
cp.ExpectExitCode(1)

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

Expand Down
16 changes: 8 additions & 8 deletions test/integration/push_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (suite *PushIntegrationTestSuite) TestPush_NoProject() {
cp.ExpectExitCode(1)

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

Expand All @@ -293,7 +293,7 @@ func (suite *PushIntegrationTestSuite) TestPush_NoAuth() {
cp.ExpectExitCode(1)

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

Expand All @@ -312,7 +312,7 @@ func (suite *PushIntegrationTestSuite) TestPush_NoChanges() {
cp.ExpectExitCode(1)

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

Expand All @@ -330,7 +330,7 @@ func (suite *PushIntegrationTestSuite) TestPush_NoCommit() {
cp.ExpectExitCode(1)

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

Expand All @@ -350,7 +350,7 @@ func (suite *PushIntegrationTestSuite) TestPush_NameInUse() {
cp.ExpectExitCode(1)

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

Expand All @@ -375,7 +375,7 @@ func (suite *PushIntegrationTestSuite) TestPush_Aborted() {
cp.ExpectExitCode(1)

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

Expand All @@ -395,7 +395,7 @@ func (suite *PushIntegrationTestSuite) TestPush_InvalidHistory() {
cp.ExpectExitCode(1)

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

Expand All @@ -414,7 +414,7 @@ func (suite *PushIntegrationTestSuite) TestPush_PullNeeded() {
cp.ExpectExitCode(1)

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

Expand Down

0 comments on commit a019466

Please sign in to comment.