Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Oct 30, 2024
1 parent 66c2e7c commit c4de876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion utils/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (s *Scan) setDefaultsIfNeeded() (err error) {
}
}
if !s.AddPrCommentOnSuccess {
if s.AddPrCommentOnSuccess, err = getBoolEnv(AddPrCommentOnSuccessEnv, false); err != nil {
if s.AddPrCommentOnSuccess, err = getBoolEnv(AddPrCommentOnSuccessEnv, true); err != nil {
return
}
}
Expand Down
4 changes: 1 addition & 3 deletions utils/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func TestExtractAndAssertRepoParams(t *testing.T) {
assert.Equal(t, "High", repo.MinSeverity)
assert.True(t, repo.FixableOnly)
assert.True(t, repo.DisableJas)
assert.True(t, repo.AddPrCommentOnSuccess)
assert.True(t, repo.DetectionOnly)
assert.Equal(t, true, repo.AggregateFixes)
assert.Equal(t, "[email protected]", repo.EmailAuthor)
Expand Down Expand Up @@ -351,7 +350,6 @@ func TestGenerateConfigAggregatorFromEnv(t *testing.T) {
IncludeAllVulnerabilitiesEnv: "true",
AvoidPreviousPrCommentsDeletionEnv: "true",
FailOnSecurityIssuesEnv: "false",
AddPrCommentOnSuccessEnv: "false",
MinSeverityEnv: "medium",
FixableOnlyEnv: "true",
DisableJasEnv: "true",
Expand Down Expand Up @@ -399,7 +397,7 @@ func validateBuildRepoAggregator(t *testing.T, repo *Repository, gitParams *Git,
assert.Equal(t, "Medium", repo.MinSeverity)
assert.Equal(t, true, repo.FixableOnly)
assert.Equal(t, true, repo.DisableJas)
assert.Equal(t, false, repo.AddPrCommentOnSuccess)
assert.Equal(t, true, repo.AddPrCommentOnSuccess)
assert.Equal(t, true, repo.DetectionOnly)
assert.ElementsMatch(t, []string{"MIT", "Apache-2.0"}, repo.AllowedLicenses)
assert.Equal(t, gitParams.RepoOwner, repo.RepoOwner)
Expand Down

0 comments on commit c4de876

Please sign in to comment.