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

dependencydiff unit tests interact with GitHub API #2715

Closed
spencerschrock opened this issue Mar 2, 2023 · 0 comments · Fixed by #2718
Closed

dependencydiff unit tests interact with GitHub API #2715

spencerschrock opened this issue Mar 2, 2023 · 0 comments · Fixed by #2718
Labels
kind/bug Something isn't working

Comments

@spencerschrock
Copy link
Member

Describe the bug
Something in the dependency diff unit test makes a single REST call.
https://github.com/ossf/scorecard/blob/846fb19724435f0c6465af44adf505ad6b2fc941/dependencydiff/dependencydiff_test.go

This causes unrelated PRs (such as #2704) to occasionally fail their unit-test step as the unauthenticated rate limit for API calls is low enough (60/hr for an IP address) that we occasionally hit it.

Reproduction steps
Steps to reproduce the behavior:

  1. Check how much of your current API quota you've used:
curl -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_AUTH_TOKEN" \
https://api.github.com/rate_limit
  1. Run the dependecy diff unit tests (either make unit-test or individually)
  2. Check your used API quota again, it should have gone up by one

Expected behavior
A unit test doesn't consume API quota. The relevant test should be modified to remove the call, or only run when e2e tests are run.

@spencerschrock spencerschrock added the kind/bug Something isn't working label Mar 2, 2023
naveensrinivasan added a commit that referenced this issue Mar 3, 2023
fixes #2715

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
spencerschrock pushed a commit that referenced this issue Mar 3, 2023
fixes #2715

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Shofiya2003 pushed a commit to Shofiya2003/scorecard that referenced this issue Mar 10, 2023
fixes ossf#2715

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: Shofiya2003 <shofiyabootwala@gmail.com>
Shofiya2003 pushed a commit to Shofiya2003/scorecard that referenced this issue Mar 10, 2023
fixes ossf#2715

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: Shofiya2003 <shofiyabootwala@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant