mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 00:45:36 +03:00
Add repoClient.Close
for all e2e tests (#1265)
Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
parent
6223b6620a
commit
72e20a076c
@ -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{}
|
||||
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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{}
|
||||
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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{}
|
||||
@ -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{}
|
||||
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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{}
|
||||
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -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() {
|
||||
@ -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())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user