⚠️ Removing the error field from result (#1853)

- Removing the error field from result
- https://github.com/ossf/scorecard/issues/1393

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
Naveen 2022-04-22 18:22:43 -05:00 committed by GitHub
parent 1f3861b4cc
commit 44ad5f53ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 54 additions and 87 deletions

View File

@ -79,7 +79,6 @@ const (
// nolint:govet // nolint:govet
type CheckResult struct { type CheckResult struct {
// TODO(#1393): Remove old structure after deprecation. // TODO(#1393): Remove old structure after deprecation.
Error error `json:"-"`
Name string Name string
Details []string Details []string
Confidence int Confidence int
@ -88,7 +87,7 @@ type CheckResult struct {
// UPGRADEv2: New structure. Omitting unchanged Name field // UPGRADEv2: New structure. Omitting unchanged Name field
// for simplicity. // for simplicity.
Version int `json:"-"` // Default value of 0 indicates old structure. Version int `json:"-"` // Default value of 0 indicates old structure.
Error2 error `json:"-"` // Runtime error indicate a filure to run the check. Error error `json:"-"` // Runtime error indicate a filure to run the check.
Details2 []CheckDetail `json:"-"` // Details of tests and sub-checks Details2 []CheckDetail `json:"-"` // Details of tests and sub-checks
Score int `json:"-"` // {[-1,0...10], -1 = Inconclusive} Score int `json:"-"` // {[-1,0...10], -1 = Inconclusive}
Reason string `json:"-"` // A sentence describing the check result (score, etc) Reason string `json:"-"` // A sentence describing the check result (score, etc)
@ -161,12 +160,11 @@ func CreateResultWithScore(name, reason string, score int) CheckResult {
return CheckResult{ return CheckResult{
Name: name, Name: name,
// Old structure. // Old structure.
Error: nil,
Confidence: MaxResultScore, Confidence: MaxResultScore,
Pass: pass, Pass: pass,
// New structure. // New structure.
Version: 2, Version: 2,
Error2: nil, Error: nil,
Score: score, Score: score,
Reason: reason, Reason: reason,
} }
@ -186,12 +184,11 @@ func CreateProportionalScoreResult(name, reason string, b, t int) CheckResult {
return CheckResult{ return CheckResult{
Name: name, Name: name,
// Old structure. // Old structure.
Error: nil,
Confidence: MaxResultConfidence, Confidence: MaxResultConfidence,
Pass: pass, Pass: pass,
// New structure. // New structure.
Version: 2, Version: 2,
Error2: nil, Error: nil,
Score: score, Score: score,
Reason: NormalizeReason(reason, score), Reason: NormalizeReason(reason, score),
} }
@ -232,12 +229,11 @@ func CreateRuntimeErrorResult(name string, e error) CheckResult {
return CheckResult{ return CheckResult{
Name: name, Name: name,
// Old structure. // Old structure.
Error: e,
Confidence: 0, Confidence: 0,
Pass: false, Pass: false,
// New structure. // New structure.
Version: 2, Version: 2,
Error2: e, Error: e,
Score: InconclusiveResultScore, Score: InconclusiveResultScore,
Reason: e.Error(), // Note: message already accessible by caller thru `Error`. Reason: e.Error(), // Note: message already accessible by caller thru `Error`.
} }

View File

@ -77,7 +77,7 @@ func logStats(ctx context.Context, startTime time.Time, result *CheckResult) err
opencensusstats.Record(ctx, stats.CheckRuntimeInSec.M(runTimeInSecs)) opencensusstats.Record(ctx, stats.CheckRuntimeInSec.M(runTimeInSecs))
if result.Error != nil { if result.Error != nil {
ctx, err := tag.New(ctx, tag.Upsert(stats.ErrorName, sce.GetName(result.Error2))) ctx, err := tag.New(ctx, tag.Upsert(stats.ErrorName, sce.GetName(result.Error)))
if err != nil { if err != nil {
return sce.WithMessage(sce.ErrScorecardInternal, fmt.Sprintf("tag.New: %v", err)) return sce.WithMessage(sce.ErrScorecardInternal, fmt.Sprintf("tag.New: %v", err))
} }
@ -109,9 +109,9 @@ func (r *Runner) Run(ctx context.Context, c Check) CheckResult {
checkRequest.Ctx = ctx checkRequest.Ctx = ctx
checkRequest.Dlogger = l checkRequest.Dlogger = l
res = c.Fn(&checkRequest) res = c.Fn(&checkRequest)
if res.Error2 != nil && errors.Is(res.Error2, sce.ErrRepoUnreachable) { if res.Error != nil && errors.Is(res.Error, sce.ErrRepoUnreachable) {
checkRequest.Dlogger.Warn(&LogMessage{ checkRequest.Dlogger.Warn(&LogMessage{
Text: fmt.Sprintf("%v", res.Error2), Text: fmt.Sprintf("%v", res.Error),
}) })
continue continue
} }

View File

@ -207,7 +207,7 @@ func TestCodereview(t *testing.T) {
res := CodeReview(&req) res := CodeReview(&req)
if tt.err != nil { if tt.err != nil {
if res.Error2 == nil { if res.Error == nil {
t.Errorf("Expected error %v, got nil", tt.err) t.Errorf("Expected error %v, got nil", tt.err)
} }
// return as we don't need to check the rest of the fields. // return as we don't need to check the rest of the fields.

View File

@ -175,7 +175,7 @@ func TestContributors(t *testing.T) {
res := Contributors(&req) res := Contributors(&req)
if tt.err != nil { if tt.err != nil {
if res.Error2 == nil { if res.Error == nil {
t.Errorf("Expected error %v, got nil", tt.err) t.Errorf("Expected error %v, got nil", tt.err)
} }
// return as we don't need to check the rest of the fields. // return as we don't need to check the rest of the fields.

View File

@ -277,8 +277,8 @@ func TestBinaryArtifacts(t *testing.T) {
t.Parallel() t.Parallel()
got := BinaryArtifacts(tt.args.name, tt.args.dl, tt.args.r) got := BinaryArtifacts(tt.args.name, tt.args.dl, tt.args.r)
if tt.wantErr { if tt.wantErr {
if got.Error2 == nil { if got.Error == nil {
t.Errorf("BinaryArtifacts() error = %v, wantErr %v", got.Error2, tt.wantErr) t.Errorf("BinaryArtifacts() error = %v, wantErr %v", got.Error, tt.wantErr)
} }
} else { } else {
if got.Score != tt.want.Score { if got.Score != tt.want.Score {

View File

@ -70,8 +70,8 @@ func TestDependencyUpdateTool(t *testing.T) {
}, },
}, },
want: checker.CheckResult{ want: checker.CheckResult{
Score: 0, Score: 0,
Error2: nil, Error: nil,
}, },
err: false, err: false,
expected: scut.TestReturn{ expected: scut.TestReturn{
@ -104,8 +104,8 @@ func TestDependencyUpdateTool(t *testing.T) {
}, },
}, },
want: checker.CheckResult{ want: checker.CheckResult{
Score: 10, Score: 10,
Error2: nil, Error: nil,
}, },
expected: scut.TestReturn{ expected: scut.TestReturn{
Error: nil, Error: nil,
@ -131,8 +131,8 @@ func TestDependencyUpdateTool(t *testing.T) {
}, },
}, },
want: checker.CheckResult{ want: checker.CheckResult{
Score: -1, Score: -1,
Error2: nil, Error: nil,
}, },
expected: scut.TestReturn{ expected: scut.TestReturn{
Error: sce.ErrScorecardInternal, Error: sce.ErrScorecardInternal,
@ -147,8 +147,8 @@ func TestDependencyUpdateTool(t *testing.T) {
dl: &scut.TestDetailLogger{}, dl: &scut.TestDetailLogger{},
}, },
want: checker.CheckResult{ want: checker.CheckResult{
Score: -1, Score: -1,
Error2: nil, Error: nil,
}, },
expected: scut.TestReturn{ expected: scut.TestReturn{
Error: sce.ErrScorecardInternal, Error: sce.ErrScorecardInternal,
@ -167,8 +167,8 @@ func TestDependencyUpdateTool(t *testing.T) {
if tt.want.Score != got.Score { if tt.want.Score != got.Score {
t.Errorf("DependencyUpdateTool() got Score = %v, want %v for %v", got.Score, tt.want.Score, tt.name) t.Errorf("DependencyUpdateTool() got Score = %v, want %v for %v", got.Score, tt.want.Score, tt.name)
} }
if tt.err && got.Error2 == nil { if tt.err && got.Error == nil {
t.Errorf("DependencyUpdateTool() error = %v, want %v for %v", got.Error2, tt.want.Error2, tt.name) t.Errorf("DependencyUpdateTool() error = %v, want %v for %v", got.Error, tt.want.Error, tt.name)
return return
} }

View File

@ -139,8 +139,8 @@ func TestWebhooks(t *testing.T) {
t.Parallel() t.Parallel()
got := Webhooks(tt.args.name, tt.args.dl, tt.args.r) got := Webhooks(tt.args.name, tt.args.dl, tt.args.r)
if tt.wantErr { if tt.wantErr {
if got.Error2 == nil { if got.Error == nil {
t.Errorf("Webhooks() error = %v, wantErr %v", got.Error2, tt.wantErr) t.Errorf("Webhooks() error = %v, wantErr %v", got.Error, tt.wantErr)
} }
} else { } else {
if got.Score != tt.want.Score { if got.Score != tt.want.Score {

View File

@ -295,8 +295,8 @@ func TestFuzzing(t *testing.T) {
} }
result := Fuzzing(&req) result := Fuzzing(&req)
if (result.Error2 != nil) != tt.wantErr { if (result.Error != nil) != tt.wantErr {
t.Errorf("Fuzzing() error = %v, wantErr %v", result.Error2, tt.wantErr) t.Errorf("Fuzzing() error = %v, wantErr %v", result.Error, tt.wantErr)
return return
} }

View File

@ -345,7 +345,7 @@ func Test_Maintained(t *testing.T) {
res := Maintained(&req) res := Maintained(&req)
if tt.err != nil { if tt.err != nil {
if res.Error2 == nil { if res.Error == nil {
t.Errorf("Expected error %v, got nil", tt.err) t.Errorf("Expected error %v, got nil", tt.err)
} }
// return as we don't need to check the rest of the fields. // return as we don't need to check the rest of the fields.

View File

@ -128,8 +128,8 @@ func TestGithubWorkflowPinning(t *testing.T) {
s, e := testIsGitHubActionsWorkflowPinned(p, content, &dl) s, e := testIsGitHubActionsWorkflowPinned(p, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -221,8 +221,8 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
s, e := testIsGitHubActionsWorkflowPinned(p, content, &dl) s, e := testIsGitHubActionsWorkflowPinned(p, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -268,8 +268,8 @@ func TestGithubWorkflowPkgManagerPinning(t *testing.T) {
s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(p, content, &dl) s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(p, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
@ -392,8 +392,8 @@ func TestDockerfilePinning(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateDockerfileIsPinned(tt.filename, content, &dl) s, e := testValidateDockerfileIsPinned(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -781,8 +781,8 @@ func TestDockerfilePinningWihoutHash(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateDockerfileIsPinned(tt.filename, content, &dl) s, e := testValidateDockerfileIsPinned(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -970,8 +970,8 @@ func TestDockerfileScriptDownload(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateDockerfileIsFreeOfInsecureDownloads(tt.filename, content, &dl) s, e := testValidateDockerfileIsFreeOfInsecureDownloads(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -1013,8 +1013,8 @@ func TestDockerfileScriptDownloadInfo(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateDockerfileIsFreeOfInsecureDownloads(tt.filename, content, &dl) s, e := testValidateDockerfileIsFreeOfInsecureDownloads(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -1123,8 +1123,8 @@ func TestShellScriptDownload(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &dl) s, e := testValidateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -1178,8 +1178,8 @@ func TestShellScriptDownloadPinned(t *testing.T) {
dl := scut.TestDetailLogger{} dl := scut.TestDetailLogger{}
s, e := testValidateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &dl) s, e := testValidateShellScriptIsFreeOfInsecureDownloads(tt.filename, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()
@ -1257,8 +1257,8 @@ func TestGitHubWorflowRunDownload(t *testing.T) {
s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(p, content, &dl) s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(p, content, &dl)
actual := checker.CheckResult{ actual := checker.CheckResult{
Score: s, Score: s,
Error2: e, Error: e,
} }
if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) { if !scut.ValidateTestReturn(t, tt.name, &tt.expected, &actual, &dl) {
t.Fail() t.Fail()

View File

@ -359,9 +359,9 @@ func TestSignedRelease(t *testing.T) {
name: "Error getting releases", name: "Error getting releases",
err: errors.New("Error getting releases"), err: errors.New("Error getting releases"),
expected: checker.CheckResult{ expected: checker.CheckResult{
Pass: false, Pass: false,
Score: -1, Score: -1,
Error2: errors.New("Error getting releases"), Error: errors.New("Error getting releases"),
}, },
}, },
} }
@ -390,7 +390,7 @@ func TestSignedRelease(t *testing.T) {
res := SignedReleases(&req) res := SignedReleases(&req)
if tt.err != nil { if tt.err != nil {
if res.Error2 == nil { if res.Error == nil {
t.Errorf("Expected error %v, got nil", tt.err) t.Errorf("Expected error %v, got nil", tt.err)
} }
// return as we don't need to check the rest of the fields. // return as we don't need to check the rest of the fields.

View File

@ -123,7 +123,7 @@ func TestWebhooks(t *testing.T) {
} }
res := WebHooks(&req) res := WebHooks(&req)
if tt.err != nil { if tt.err != nil {
if res.Error2 == nil { if res.Error == nil {
t.Errorf("Expected error %v, got nil", tt.err) t.Errorf("Expected error %v, got nil", tt.err)
} }
// return as we don't need to check the rest of the fields. // return as we don't need to check the rest of the fields.

View File

@ -118,10 +118,10 @@ func processRequest(ctx context.Context,
} }
for checkIndex := range result.Checks { for checkIndex := range result.Checks {
check := &result.Checks[checkIndex] check := &result.Checks[checkIndex]
if !errors.Is(check.Error2, sce.ErrScorecardInternal) { if !errors.Is(check.Error, sce.ErrScorecardInternal) {
continue continue
} }
errorMsg := fmt.Sprintf("check %s has a runtime error: %v", check.Name, check.Error2) errorMsg := fmt.Sprintf("check %s has a runtime error: %v", check.Name, check.Error)
if !(*ignoreRuntimeErrors) { if !(*ignoreRuntimeErrors) {
// nolint: goerr113 // nolint: goerr113
return errors.New(errorMsg) return errors.New(errorMsg)

View File

@ -86,7 +86,6 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() {
result := checks.BinaryArtifacts(&req) result := checks.BinaryArtifacts(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "binary artifacts", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "binary artifacts", &expected, &result, &dl)).Should(BeTrue())
@ -117,7 +116,6 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() {
result := checks.BinaryArtifacts(&req) result := checks.BinaryArtifacts(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "binary artifacts", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "binary artifacts", &expected, &result, &dl)).Should(BeTrue())

View File

@ -54,7 +54,6 @@ var _ = Describe("E2E TEST PAT:"+checks.CheckBranchProtection, func() {
result := checks.BranchProtection(&req) result := checks.BranchProtection(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
@ -86,7 +85,6 @@ var _ = Describe("E2E TEST PAT:"+checks.CheckBranchProtection, func() {
result := checks.BranchProtection(&req) result := checks.BranchProtection(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
@ -118,7 +116,6 @@ var _ = Describe("E2E TEST PAT:"+checks.CheckBranchProtection, func() {
result := checks.BranchProtection(&req) result := checks.BranchProtection(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
@ -146,9 +143,9 @@ var _ = Describe("E2E TEST GITHUB_TOKEN:"+checks.CheckBranchProtection, func() {
} }
result := checks.BranchProtection(&req) result := checks.BranchProtection(&req)
Expect(result.Error).ShouldNot(BeNil())
// There should be an error with the GITHUB_TOKEN, until it's supported // There should be an error with the GITHUB_TOKEN, until it's supported
// byt GitHub. // byt GitHub.
Expect(result.Error).ShouldNot(BeNil())
Expect(repoClient.Close()).Should(BeNil()) Expect(repoClient.Close()).Should(BeNil())
}) })
}) })

View File

@ -52,7 +52,6 @@ var _ = Describe("E2E TEST:"+checks.CheckCIIBestPractices, func() {
result := checks.CIIBestPractices(&req) result := checks.CIIBestPractices(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "passing badge", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "passing badge", &expected, &result, &dl)).Should(BeTrue())

View File

@ -52,7 +52,6 @@ var _ = Describe("E2E TEST:"+checks.CheckContributors, func() {
result := checks.Contributors(&req) result := checks.Contributors(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "several contributors", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "several contributors", &expected, &result, &dl)).Should(BeTrue())

View File

@ -56,7 +56,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue())
@ -85,7 +84,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue())
@ -126,7 +124,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "dangerous workflow", &expected, &result, &dl)).Should(BeTrue())

View File

@ -56,7 +56,6 @@ var _ = Describe("E2E TEST:"+checks.CheckDependencyUpdateTool, func() {
result := checks.DependencyUpdateTool(&req) result := checks.DependencyUpdateTool(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "dependabot", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "dependabot", &expected, &result, &dl)).Should(BeTrue())
@ -86,7 +85,6 @@ var _ = Describe("E2E TEST:"+checks.CheckDependencyUpdateTool, func() {
result := checks.DependencyUpdateTool(&req) result := checks.DependencyUpdateTool(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "renovabot", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "renovabot", &expected, &result, &dl)).Should(BeTrue())

View File

@ -54,7 +54,6 @@ var _ = Describe("E2E TEST:"+checks.CheckLicense, func() {
} }
result := checks.License(&req) result := checks.License(&req)
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result, Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result,
@ -82,7 +81,6 @@ var _ = Describe("E2E TEST:"+checks.CheckLicense, func() {
} }
result := checks.License(&req) result := checks.License(&req)
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result, Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result,
@ -122,7 +120,6 @@ var _ = Describe("E2E TEST:"+checks.CheckLicense, func() {
} }
result := checks.License(&req) result := checks.License(&req)
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result, Expect(scut.ValidateTestReturn(nil, "license found", &expected, &result,

View File

@ -52,7 +52,6 @@ var _ = Describe("E2E TEST:"+checks.CheckMaintained, func() {
result := checks.Maintained(&req) result := checks.Maintained(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "active repo", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "active repo", &expected, &result, &dl)).Should(BeTrue())

View File

@ -56,7 +56,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue())
@ -86,7 +85,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue())
@ -128,7 +126,6 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue())

View File

@ -52,7 +52,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSAST, func() {
result := checks.SAST(&req) result := checks.SAST(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "sast used", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "sast used", &expected, &result, &dl)).Should(BeTrue())

View File

@ -56,7 +56,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
result := checks.SecurityPolicy(&req) result := checks.SecurityPolicy(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
@ -86,7 +85,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
result := checks.SecurityPolicy(&req) result := checks.SecurityPolicy(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
@ -116,7 +114,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
result := checks.SecurityPolicy(&req) result := checks.SecurityPolicy(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
@ -146,7 +143,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
result := checks.SecurityPolicy(&req) result := checks.SecurityPolicy(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
@ -187,7 +183,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSecurityPolicy, func() {
result := checks.SecurityPolicy(&req) result := checks.SecurityPolicy(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())

View File

@ -52,7 +52,6 @@ var _ = Describe("E2E TEST:"+checks.CheckSignedReleases, func() {
result := checks.SignedReleases(&req) result := checks.SignedReleases(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "verified release", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "verified release", &expected, &result, &dl)).Should(BeTrue())

View File

@ -55,7 +55,6 @@ var _ = Describe("E2E TEST:"+checks.CheckVulnerabilities, func() {
result := checks.Vulnerabilities(&req) result := checks.Vulnerabilities(&req)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeTrue()) Expect(result.Pass).Should(BeTrue())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "no osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "no osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue())
@ -87,7 +86,6 @@ var _ = Describe("E2E TEST:"+checks.CheckVulnerabilities, func() {
result := checks.Vulnerabilities(&checkRequest) result := checks.Vulnerabilities(&checkRequest)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue())
@ -118,7 +116,6 @@ var _ = Describe("E2E TEST:"+checks.CheckVulnerabilities, func() {
result := checks.Vulnerabilities(&checkRequest) result := checks.Vulnerabilities(&checkRequest)
// UPGRADEv2: to remove. // UPGRADEv2: to remove.
// Old version. // Old version.
Expect(result.Error).Should(BeNil())
Expect(result.Pass).Should(BeFalse()) Expect(result.Pass).Should(BeFalse())
// New version. // New version.
Expect(scut.ValidateTestReturn(nil, "osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue()) Expect(scut.ValidateTestReturn(nil, "osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue())