ci: skip flaky live-network gitleaks test with -short - #27
Merged
Conversation
The gitleaks binary-download tests hit the live GitHub API to resolve the latest release, and flake with HTTP 403 on shared CI runners due to anonymous rate limiting. Both tests already self-skip under -short; the CI invocation just wasn't passing it. The real download path stays covered by the integration suite. Coverage remains 55.3%, above the 50% gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
-shortto the CIgo testinvocation so the gitleaks binary-download tests, which hit the live GitHub API, are skipped in CI. These flake with HTTP 403 on shared runners due to anonymous rate limiting.Related Issue
The
Go Testsjob intermittently fails onTestBinaryManager_Download_LatestwithGitHub API returned HTTP 403. Most recently on themainmerge of #26.Type of Change
Motivation
TestBinaryManager_Download_LatestandTestBinaryManager_Downloadresolve the latest gitleaks release via an unauthenticated GitHub API call. Shared CI runner IPs hit GitHub's 60-request/hour anonymous rate limit and get a 403, failing the job through no fault of the change under test. Both tests already guard withtesting.Short(), but the CI command was not passing-short, so the guard never fired.Changes
.github/workflows/test.yml: add-shortto thego testcommand for internal packages, with a comment explaining why. The real download path remains covered by the integration suite.Testing
go test ./...)Measured coverage locally with
-short: 55.3%, above the 50% gate (down from 57.6% full, since the two download tests are skipped). Confirmed the full internal suite passes with-short -race.Checklist
Note
v1.0.3 already released successfully (GoReleaser does not run this test job), so no re-tag is needed. This just makes
maingreen again and stops the flake recurring.