Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Use captain for test aggregation (#3328)
Dustin Decker3b0f2fcf398a
diff --git a/.captain/config.yaml b/.captain/config.yamlnew file mode 100644index 000000000..311b809cf--- /dev/null+++ b/.captain/config.yaml@@ -0,0 +1,11 @@+test-suites:+ detectors:+ command: gotestsum --jsonfile tmp/go-test.json --raw-command -- go test -tags=detectors -timeout=15m -json -count=1 -vet=off ./pkg/detectors+ results:+ path: tmp/go-test.json+ output:+ print-summary: true+ ## No retries right now+ # retries:+ # attempts: 3+ # command: gotestsum --raw-command --jsonfile tmp/go-test.json -- go test -tags=detectors -timeout=15m -json -count=1 -vet=off {{ package }} -run '{{ run }}'diff --git a/.github/workflows/detector-tests.yml b/.github/workflows/detector-tests.ymlindex 203d059e5..65aa678ea 100644--- a/.github/workflows/detector-tests.yml+++ b/.github/workflows/detector-tests.yml@@ -14,35 +14,16 @@ jobs:contents: "read"id-token: "write"steps:- - name: Install Go- uses: actions/setup-go@v5+ - uses: actions/setup-go@v5+ - uses: actions/checkout@v4+ - name: Install gotestsum+ uses: jaxxstorm/[email protected]with:- go-version: "1.22"- - name: Checkout code- uses: actions/checkout@v4- - id: "auth"- uses: "google-github-actions/auth@v2"- with:- workload_identity_provider: "projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider"- service_account: "[email protected]"- - name: Test integration- continue-on-error: true- run: make test-integration- - name: Set up gotestsum- run: |- go install gotest.tools/gotestsum@latest- mkdir -p tmp/test-results- - name: Test detectors+ repo: gotestyourself/gotestsum+ - uses: rwx-research/setup-captain@v1+ - name: Test Gorun: |- CGO_ENABLED=1 gotestsum --junitfile tmp/test-results/test.xml --raw-command -- go test -json -tags=detectors -timeout=15m $(go list ./... | grep pkg/detectors)- - name: Upload test results to BuildPulse for flaky test detection- if: ${{ !cancelled() }} # Run this step even when the tests fail. Skip if the workflow is cancelled.- uses: buildpulse/buildpulse-action@main- with:- account: 79229934- repository: 694446374- path: |- tmp/test-results/*.xml- key: ${{ secrets.BUILDPULSE_DETECTORS_ACCESS_KEY_ID }}- secret: ${{ secrets.BUILDPULSE_DETECTORS_SECRET_ACCESS_KEY }}- tags: detectors+ export CGO_ENABLED=1+ captain run detectors+ env:+ RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}