Skip to content

Commit

Permalink
Add repoClient.Close for all e2e tests (#1265)
Browse files Browse the repository at this point in the history
Co-authored-by: Azeem Shaikh <[email protected]>
  • Loading branch information
azeemshaikh38 and azeemsgoogle authored Nov 15, 2021
1 parent 6223b66 commit 72e20a0
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions e2e/binary_artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() {

result := checks.BinaryArtifacts(&req)
Expect(scut.ValidateTestReturn(nil, "no binary artifacts", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
It("Should return binary artifacts present in source code", func() {
dl := scut.TestDetailLogger{}
Expand Down Expand Up @@ -84,6 +85,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() {
Expect(result.Pass).Should(BeFalse())
// New version.
Expect(scut.ValidateTestReturn(nil, " binary artifacts", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/branch_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBranchProtection, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "branch protection accessible", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/ci_tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var _ = Describe("E2E TEST:"+checks.CheckCITests, func() {
}
result := checks.CITests(&req)
Expect(scut.ValidateTestReturn(nil, "CI tests run", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/code_review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var _ = Describe("E2E TEST:CodeReview", func() {
}
result := checks.DoesCodeReview(&req)
Expect(scut.ValidateTestReturn(nil, "use code reviews", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/contributors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckContributors, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "several contributors", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
2 changes: 2 additions & 0 deletions e2e/dependency_update_tool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var _ = Describe("E2E TEST:"+checks.CheckDependencyUpdateTool, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "dependabot", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
It("Should return repo uses renovatebot", func() {
dl := scut.TestDetailLogger{}
Expand Down Expand Up @@ -88,6 +89,7 @@ var _ = Describe("E2E TEST:"+checks.CheckDependencyUpdateTool, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "renovabot", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
3 changes: 3 additions & 0 deletions e2e/fuzzing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var _ = Describe("E2E TEST:"+checks.CheckFuzzing, func() {
}
result := checks.Fuzzing(&req)
Expect(scut.ValidateTestReturn(nil, "use fuzzing", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
It("Should return use of ClusterFuzzLite", func() {
dl := scut.TestDetailLogger{}
Expand All @@ -73,6 +74,7 @@ var _ = Describe("E2E TEST:"+checks.CheckFuzzing, func() {
}
result := checks.Fuzzing(&req)
Expect(scut.ValidateTestReturn(nil, "use fuzzing", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
It("Should return no fuzzing", func() {
dl := scut.TestDetailLogger{}
Expand All @@ -96,6 +98,7 @@ var _ = Describe("E2E TEST:"+checks.CheckFuzzing, func() {
}
result := checks.Fuzzing(&req)
Expect(scut.ValidateTestReturn(nil, "no fuzzing", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/maintained_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckMaintained, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "active repo", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/packaging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var _ = Describe("E2E TEST:"+checks.CheckPackaging, func() {
}
result := checks.Packaging(&req)
Expect(scut.ValidateTestReturn(nil, "use packaging", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckTokenPermissions, func() {
Expect(result.Pass).Should(BeFalse())
// New version.
Expect(scut.ValidateTestReturn(nil, "token permissions", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/pinned_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var _ = Describe("E2E TEST:"+checks.CheckPinnedDependencies, func() {
}
result := checks.PinnedDependencies(&req)
Expect(scut.ValidateTestReturn(nil, "dependencies check", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/sast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckSAST, func() {
Expect(result.Pass).Should(BeFalse())
// New version.
Expect(scut.ValidateTestReturn(nil, "sast used", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
2 changes: 2 additions & 0 deletions e2e/security_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:SecurityPolicy", func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
It("Should return valid security policy for rust repositories", func() {
dl := scut.TestDetailLogger{}
Expand Down Expand Up @@ -84,6 +85,7 @@ var _ = Describe("E2E TEST:SecurityPolicy", func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "policy found", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
1 change: 1 addition & 0 deletions e2e/signedreleases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("E2E TEST:"+checks.CheckSignedReleases, func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "verified release", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})
2 changes: 2 additions & 0 deletions e2e/vulnerabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var _ = Describe("E2E TEST:Vulnerabilities", func() {
Expect(result.Pass).Should(BeTrue())
// New version.
Expect(scut.ValidateTestReturn(nil, "no osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})

It("Should return that there are vulnerabilities", func() {
Expand Down Expand Up @@ -86,6 +87,7 @@ var _ = Describe("E2E TEST:Vulnerabilities", func() {
Expect(result.Pass).Should(BeFalse())
// New version.
Expect(scut.ValidateTestReturn(nil, "osv vulnerabilities", &expected, &result, &dl)).Should(BeTrue())
Expect(repoClient.Close()).Should(BeNil())
})
})
})

0 comments on commit 72e20a0

Please sign in to comment.