Add repoClient.Close for all e2e tests (#1265)

Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
Azeem Shaikh 2021-11-14 22:53:01 -05:00 committed by GitHub
parent 6223b6620a
commit 72e20a076c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 21 additions and 0 deletions

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})

View File

@ -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())
})
})
})