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 search API tests #3377

Merged
merged 2 commits into from
Aug 11, 2023
Merged

Conversation

naveensrinivasan
Copy link
Member

  • Add tests for search() function, including valid response and error handling

What kind of change does this PR introduce?

(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 11, 2023
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 11, 2023 21:35 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan temporarily deployed to integration-test August 11, 2023 21:35 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #3377 (6a9209f) into main (e95247a) will increase coverage by 0.17%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3377      +/-   ##
==========================================
+ Coverage   62.34%   62.51%   +0.17%     
==========================================
  Files         178      178              
  Lines       12876    12876              
==========================================
+ Hits         8028     8050      +22     
+ Misses       4409     4385      -24     
- Partials      439      441       +2     

clients/gitlabrepo/search_test.go Show resolved Hide resolved
clients/gitlabrepo/search_test.go Show resolved Hide resolved
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 11, 2023 22:25 — with GitHub Actions Inactive
- Add tests for `search()` function, including valid response and error handling

Signed-off-by: naveensrinivasan <[email protected]>
- Add test for valid search with zero results
- Update expected response for valid search with zero results
- Update failure fetching search test

[clients/gitlabrepo/testdata/valid-search-result-1]
- Add an empty array to the `valid-search-result-1` test file
[clients/gitlabrepo/search_test.go]
- Add a test for valid search with zero results
- Change the expected response for a valid search with zero results
- Update the failure fetching search test

Signed-off-by: naveensrinivasan <[email protected]>
@naveensrinivasan naveensrinivasan temporarily deployed to gitlab August 11, 2023 22:25 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan enabled auto-merge (squash) August 11, 2023 22:25
@naveensrinivasan naveensrinivasan temporarily deployed to integration-test August 11, 2023 22:25 — with GitHub Actions Inactive
@naveensrinivasan naveensrinivasan merged commit 198aa96 into main Aug 11, 2023
38 checks passed
@naveensrinivasan naveensrinivasan deleted the naveen/unit-tests/gitlab/search branch August 11, 2023 22:34
ashearin pushed a commit to kgangerlm/scorecard-gitlab that referenced this pull request Nov 13, 2023
* 🌱 Gitlab search API tests

- Add tests for `search()` function, including valid response and error handling

Signed-off-by: naveensrinivasan <[email protected]>

* Improve search tests and data

- Add test for valid search with zero results
- Update expected response for valid search with zero results
- Update failure fetching search test

[clients/gitlabrepo/testdata/valid-search-result-1]
- Add an empty array to the `valid-search-result-1` test file
[clients/gitlabrepo/search_test.go]
- Add a test for valid search with zero results
- Change the expected response for a valid search with zero results
- Update the failure fetching search test

Signed-off-by: naveensrinivasan <[email protected]>

---------

Signed-off-by: naveensrinivasan <[email protected]>
Signed-off-by: Allen Shearin <[email protected]>
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.

2 participants