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

🌱 E2e Gitlab Issues #3343

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

naveensrinivasan
Copy link
Member

@naveensrinivasan naveensrinivasan commented Aug 3, 2023

What kind of change does this PR introduce?

E2e tests for Gitlab issues. The list issues will fail as it requires additional permissions.

(Is it a bug fix, feature, docs update, something else?)

What is the current behavior?

What is the new behavior (if this is a feature change)?**

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)


@naveensrinivasan naveensrinivasan self-assigned this Aug 3, 2023
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 3, 2023 01:12 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan temporarily deployed to integration-test August 3, 2023 01:13 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #3343 (a4b6825) into main (a8b255a) will decrease coverage by 11.74%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3343       +/-   ##
===========================================
- Coverage   73.62%   61.89%   -11.74%     
===========================================
  Files         178      178               
  Lines       12864    12864               
===========================================
- Hits         9471     7962     -1509     
- Misses       2854     4462     +1608     
+ Partials      539      440       -99     

Copy link
Contributor

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested more details. The PR template was empty, and the test didn't clarify much.

clients/gitlabrepo/issues_e2e_test.go Outdated Show resolved Hide resolved
clients/gitlabrepo/issues_e2e_test.go Outdated Show resolved Hide resolved
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 3, 2023 20:05 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan temporarily deployed to integration-test August 3, 2023 20:05 — with GitHub Actions Inactive
@naveensrinivasan
Copy link
Member Author

Requested more details. The PR template was empty, and the test didn't clarify much.

I have updated it. This is e2e tests for GitLab issues. The Gitlab issues API requires additional permissions that would prevent the normal token from fetching the issues.

- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

[clients/gitlabrepo/issues_e2e_test.go]
- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

[clients/gitlabrepo/issues_e2e_test.go]
- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
- Update context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test to return errors when listing for issues with normal token

[clients/gitlabrepo/issues_e2e_test.go]
- Change context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test from "returns branches for the repo" to "returns errors when listing for issues with normal token"

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
@naveensrinivasan naveensrinivasan force-pushed the naveen/e2e/clients/gitlabrepo/issues.go branch from d6f8659 to a4b6825 Compare August 4, 2023 17:27
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 4, 2023 17:27 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan enabled auto-merge (squash) August 4, 2023 17:27
@naveensrinivasan naveensrinivasan temporarily deployed to integration-test August 4, 2023 17:27 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan merged commit 76dc144 into main Aug 4, 2023
37 of 38 checks passed
@naveensrinivasan naveensrinivasan deleted the naveen/e2e/clients/gitlabrepo/issues.go branch August 4, 2023 17:37
ashearin pushed a commit to kgangerlm/scorecard-gitlab that referenced this pull request Nov 13, 2023
* 🌱 Add E2E tests for Gitlab repo issues

- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

[clients/gitlabrepo/issues_e2e_test.go]
- Add an E2E test for Gitlab repo issues
- Add two tests: one for a repo with issues, one for a repo without issues

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Improve issue e2e tests & error handling

- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

[clients/gitlabrepo/issues_e2e_test.go]
- Remove copyright notice and associated code from `clients/gitlabrepo/issues_e2e_test.go`
- Change `ListIssues` to return an error if `ListAllProjectMembers` is not available

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

* Improve GitLab issues error handling

- Update context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test to return errors when listing for issues with normal token

[clients/gitlabrepo/issues_e2e_test.go]
- Change context of test from "Test list issues - GitLab" to "Test list issues errors - GitLab"
- Change test from "returns branches for the repo" to "returns errors when listing for issues with normal token"

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants