Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsimon committed Feb 4, 2022
1 parent 91899da commit e28c173
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions checks/pinned_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
}{
{
name: "Pinned non-github workflow",
filename: "./testdata/workflow-non-github-pinned.yaml",
filename: "./testdata/.github/workflows/workflow-non-github-pinned.yaml",
expected: scut.TestReturn{
Error: nil,
Score: checker.MaxResultScore,
Expand All @@ -158,7 +158,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
},
{
name: "Pinned github workflow",
filename: "./testdata/workflow-mix-github-and-non-github-not-pinned.yaml",
filename: "./testdata/.github/workflows/workflow-mix-github-and-non-github-not-pinned.yaml",
expected: scut.TestReturn{
Error: nil,
Score: checker.MinResultScore,
Expand All @@ -169,7 +169,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
},
{
name: "Pinned github workflow",
filename: "./testdata/workflow-mix-github-and-non-github-pinned.yaml",
filename: "./testdata/.github/workflows/workflow-mix-github-and-non-github-pinned.yaml",
expected: scut.TestReturn{
Error: nil,
Score: checker.MaxResultScore,
Expand All @@ -180,7 +180,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
},
{
name: "Mix of pinned and non-pinned GitHub actions",
filename: "./testdata/workflow-mix-pinned-and-non-pinned-github.yaml",
filename: "./testdata/.github/workflows/workflow-mix-pinned-and-non-pinned-github.yaml",
expected: scut.TestReturn{
Error: nil,
Score: checker.MaxResultScore - 2,
Expand All @@ -191,7 +191,7 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
},
{
name: "Mix of pinned and non-pinned non-GitHub actions",
filename: "./testdata/workflow-mix-pinned-and-non-pinned-non-github.yaml",
filename: "./testdata/.github/workflows/workflow-mix-pinned-and-non-pinned-non-github.yaml",
expected: scut.TestReturn{
Error: nil,
Score: checker.MaxResultScore - 8,
Expand All @@ -216,7 +216,9 @@ func TestNonGithubWorkflowPinning(t *testing.T) {
}
}
dl := scut.TestDetailLogger{}
s, e := testIsGitHubActionsWorkflowPinned(tt.filename, content, &dl)
p := strings.Replace(tt.filename, "./testdata/", "", 1)

s, e := testIsGitHubActionsWorkflowPinned(p, content, &dl)
actual := checker.CheckResult{
Score: s,
Error2: e,
Expand Down Expand Up @@ -261,7 +263,9 @@ func TestGithubWorkflowPkgManagerPinning(t *testing.T) {
}

dl := scut.TestDetailLogger{}
s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(tt.filename, content, &dl)
p := strings.Replace(tt.filename, "./testdata/", "", 1)

s, e := testValidateGitHubWorkflowScriptFreeOfInsecureDownloads(p, content, &dl)
actual := checker.CheckResult{
Score: s,
Error2: e,
Expand Down

0 comments on commit e28c173

Please sign in to comment.