Skip to content

Commit

Permalink
convert attestor 2
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Schrock <[email protected]>
  • Loading branch information
spencerschrock committed Jul 2, 2024
1 parent 20c0424 commit 5e651e4
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions e2e/attestor_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import (

"github.com/ossf/scorecard/v5/attestor/command"
"github.com/ossf/scorecard/v5/attestor/policy"
"github.com/ossf/scorecard/v5/checker"
"github.com/ossf/scorecard/v5/checks"
"github.com/ossf/scorecard/v5/clients"
sclog "github.com/ossf/scorecard/v5/log"
"github.com/ossf/scorecard/v5/clients/githubrepo"
"github.com/ossf/scorecard/v5/internal/checknames"
"github.com/ossf/scorecard/v5/pkg"
)

Expand Down Expand Up @@ -226,27 +224,15 @@ var _ = Describe("E2E TEST PAT: scorecard-attestor policy", func() {

func getScorecardResult(repoURL string) (pkg.ScorecardResult, error) {
ctx := context.Background()
logger := sclog.NewLogger(sclog.DefaultLevel)

enabledChecks := map[string]checker.Check{
checks.CheckBinaryArtifacts: {
Fn: checks.BinaryArtifacts,
},
checks.CheckVulnerabilities: {
Fn: checks.Vulnerabilities,
},
checks.CheckCodeReview: {
Fn: checks.CodeReview,
},
checks.CheckPinnedDependencies: {
Fn: checks.PinningDependencies,
},
enabledChecks := []string{
checknames.BinaryArtifacts,
checknames.Vulnerabilities,
checknames.CodeReview,
checknames.PinnedDependencies,
}
repo, repoClient, ossFuzzRepoClient, ciiClient, vulnsClient, projectClient, err := checker.GetClients(
ctx, repoURL, "", logger)
repo, err := githubrepo.MakeGithubRepo(repoURL)
if err != nil {
return pkg.ScorecardResult{}, fmt.Errorf("couldn't set up clients: %w", err)
return pkg.ScorecardResult{}, fmt.Errorf("couldn't set up repo: %w", err)
}

return pkg.RunScorecard(ctx, repo, clients.HeadSHA, 0, enabledChecks, repoClient, ossFuzzRepoClient, ciiClient, vulnsClient, projectClient)
return pkg.Run(ctx, repo, pkg.WithChecks(enabledChecks))
}

0 comments on commit 5e651e4

Please sign in to comment.