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

🐛 Gitlab: test fixes #3027

Merged
merged 9 commits into from
May 24, 2023
Merged
2 changes: 1 addition & 1 deletion clients/gitlabrepo/checkruns.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (handler *checkrunsHandler) init(repourl *repoURL) {

func (handler *checkrunsHandler) listCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
pipelines, _, err := handler.glClient.Pipelines.ListProjectPipelines(
handler.repourl.project, &gitlab.ListProjectPipelinesOptions{})
handler.repourl.projectID, &gitlab.ListProjectPipelinesOptions{})
if err != nil {
return nil, fmt.Errorf("request for pipelines returned error: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions clients/gitlabrepo/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (handler *issuesHandler) init(repourl *repoURL) {
func (handler *issuesHandler) setup() error {
handler.once.Do(func() {
issues, _, err := handler.glClient.Issues.ListProjectIssues(
handler.repourl.project, &gitlab.ListProjectIssuesOptions{})
handler.repourl.projectID, &gitlab.ListProjectIssuesOptions{})
if err != nil {
handler.errSetup = fmt.Errorf("unable to find issues associated with the project id: %w", err)
return
Expand All @@ -49,7 +49,7 @@ func (handler *issuesHandler) setup() error {
// There doesn't seem to be a good way to get user access_levels in gitlab so the following way may seem incredibly
// barberic, however I couldn't find a better way in the docs.
projMemberships, resp, err := handler.glClient.ProjectMembers.ListAllProjectMembers(
handler.repourl.project, &gitlab.ListProjectMembersOptions{})
handler.repourl.projectID, &gitlab.ListProjectMembersOptions{})
if err != nil && resp.StatusCode != 401 {
handler.errSetup = fmt.Errorf("unable to find access tokens associated with the project id: %w", err)
return
Expand Down
2 changes: 1 addition & 1 deletion clients/gitlabrepo/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (handler *projectHandler) init(repourl *repoURL) {

func (handler *projectHandler) setup() error {
handler.once.Do(func() {
proj, _, err := handler.glClient.Projects.GetProject(handler.repourl.project, &gitlab.GetProjectOptions{})
proj, _, err := handler.glClient.Projects.GetProject(handler.repourl.projectID, &gitlab.GetProjectOptions{})
if err != nil {
handler.errSetup = fmt.Errorf("request for project failed with error %w", err)
return
Expand Down
2 changes: 1 addition & 1 deletion clients/gitlabrepo/statuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (handler *statusesHandler) init(repourl *repoURL) {
// for gitlab this only works if ref is SHA.
func (handler *statusesHandler) listStatuses(ref string) ([]clients.Status, error) {
commitStatuses, _, err := handler.glClient.Commits.GetCommitStatuses(
handler.repourl.project, ref, &gitlab.GetCommitStatusesOptions{})
handler.repourl.projectID, ref, &gitlab.GetCommitStatusesOptions{})
if err != nil {
return nil, fmt.Errorf("error getting commit statuses: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/ci_tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var _ = Describe("E2E TEST:"+checks.CheckCITests, func() {
}
expected := scut.TestReturn{
Error: nil,
Score: 0,
Score: 9,
NumberOfWarn: 0,
NumberOfInfo: 0,
NumberOfDebug: 13,
Expand Down Expand Up @@ -151,7 +151,7 @@ var _ = Describe("E2E TEST:"+checks.CheckCITests, func() {
}
expected := scut.TestReturn{
Error: nil,
Score: 3,
Score: 7,
NumberOfWarn: 0,
NumberOfInfo: 0,
NumberOfDebug: 1,
Expand Down
10 changes: 6 additions & 4 deletions e2e/code_review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ var _ = Describe("E2E TEST:"+checks.CheckCodeReview, func() {
Dlogger: &dl,
}
expected := scut.TestReturn{
Error: nil,
Score: 3,
Error: nil,
Score: 3,
NumberOfDebug: 1,
}
result := checks.CodeReview(&req)
Expect(scut.ValidateTestReturn(nil, "use code reviews", &expected, &result, &dl)).Should(BeTrue())
Expand All @@ -197,8 +198,9 @@ var _ = Describe("E2E TEST:"+checks.CheckCodeReview, func() {
Dlogger: &dl,
}
expected := scut.TestReturn{
Error: nil,
Score: checker.MinResultScore,
Error: nil,
Score: checker.MinResultScore,
NumberOfDebug: 1,
}
result := checks.CodeReview(&req)
Expect(scut.ValidateTestReturn(nil, "use code reviews", &expected, &result, &dl)).Should(BeTrue())
Expand Down