Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Improve search commit e2e tests #3295

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions e2e/searchCommits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,21 @@ var _ = Describe("E2E TEST:SearchCommits", func() {
Expect(err).Should(BeNil())
Expect(len(commits)).Should(BeNumerically(">", 0))
})
It("Should return error as it is not using HEAD", func() {
repo, err := githubrepo.MakeGithubRepo("ossf/scorecard")
spencerschrock marked this conversation as resolved.
Show resolved Hide resolved
Expect(err).Should(BeNil())
repoClient := githubrepo.CreateGithubRepoClient(context.Background(), logger)
err = repoClient.InitRepo(repo, "123456789", 0)
Expect(err).ShouldNot(Not(BeNil()))
})
It("Should return error as the user does not exists", func() {
repo, err := githubrepo.MakeGithubRepo("ossf/scorecard")
spencerschrock marked this conversation as resolved.
Show resolved Hide resolved
Expect(err).Should(BeNil())
repoClient := githubrepo.CreateGithubRepoClient(context.Background(), logger)
err = repoClient.InitRepo(repo, clients.HeadSHA, 0)
Expect(err).Should(BeNil())
_, err = repoClient.SearchCommits(clients.SearchCommitsOptions{Author: "thisuserdoesnotexists"})
Expect(err).ShouldNot(BeNil())
})
})
})