{"id":17785055,"url":"https://github.com/eun/go-test-buckets","last_synced_at":"2026-02-22T22:42:32.159Z","repository":{"id":40373788,"uuid":"232130860","full_name":"Eun/go-test-buckets","owner":"Eun","description":"Split your go tests into buckets.","archived":false,"fork":false,"pushed_at":"2024-05-08T04:33:35.000Z","size":58,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-20T14:43:12.891Z","etag":null,"topics":["go","golang","golang-testing","testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Eun"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"Eun","issuehunt":"eun","otechie":null,"custom":null}},"created_at":"2020-01-06T15:35:58.000Z","updated_at":"2021-12-14T10:22:35.000Z","dependencies_parsed_at":"2024-05-06T05:33:11.484Z","dependency_job_id":"83155429-2fae-403b-af53-10b865b7240e","html_url":"https://github.com/Eun/go-test-buckets","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Eun/go-test-buckets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fgo-test-buckets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fgo-test-buckets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fgo-test-buckets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fgo-test-buckets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eun","download_url":"https://codeload.github.com/Eun/go-test-buckets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eun%2Fgo-test-buckets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267436539,"owners_count":24086898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-testing","testing"],"created_at":"2024-10-27T08:23:08.687Z","updated_at":"2025-10-30T17:45:58.559Z","avatar_url":"https://github.com/Eun.png","language":"Go","funding_links":["https://github.com/sponsors/Eun","https://liberapay.com/Eun","https://issuehunt.io/r/eun"],"categories":[],"sub_categories":[],"readme":"# go-test-buckets\n[![Actions Status](https://github.com/Eun/go-test-buckets/workflows/push/badge.svg)](https://github.com/Eun/go-test-buckets/actions)\n[![Coverage Status](https://coveralls.io/repos/github/Eun/go-test-buckets/badge.svg?branch=master)](https://coveralls.io/github/Eun/go-test-buckets?branch=master)\n[![PkgGoDev](https://img.shields.io/badge/pkg.go.dev-reference-blue)](https://pkg.go.dev/github.com/Eun/go-test-buckets)\n[![go-report](https://goreportcard.com/badge/github.com/Eun/go-test-buckets)](https://goreportcard.com/report/github.com/Eun/go-test-buckets)\n---\nSplit your go tests into buckets, or exclude some packages/directories.\n\n## Buckets\n```golang\npackage main_test\n\nimport (\n\t\"testing\"\n\t\"os\"\n\n\t\"github.com/Eun/go-test-buckets\"\n)\n\nfunc TestMain(m *testing.M) {\n\tbuckets.Buckets(m)\n\tos.Exit(m.Run())\n}\n\n// run with BUCKET=0 TOTAL_BUCKETS=2 go test -count=1 -v ./...\n// will run TestA and TestB\n\n// run with BUCKET=1 TOTAL_BUCKETS=2 go test -count=1 -v ./...\n// will run TestC\n\nfunc TestA(t *testing.T) {\n}\n\nfunc TestB(t *testing.T) {\n}\n\nfunc TestC(t *testing.T) {\n}\n```\n\n## Excluding Packages/Directories\n1. Add to your package\n   ```go\n   func TestMain(m *testing.M) {\n       buckets.Buckets(m)\n       os.Exit(m.Run())\n   }\n   ```\n2. Run `EXCLUDE_PACKAGES=package/path/to/exclude,package/path/to/exclude-2 go test -count=1 -v ./...`\n3. Or `EXCLUDE_DIRECTORIES=/full/path/to/exclude go test -count=1 -v ./...`\n\n\n\n\u003e Because of `go test` package separation, you have to call `buckets.Buckets(m)` in every package you want to ignore.\n\n## Why?\nSpeed up ci pipelines by parallelizing go tests without thinking about [t.Parallel](https://golang.org/pkg/testing/#T.Parallel).\nAnd getting rid of weird piping `go test $(go list ./... | grep -v /ignore/)`\n\n\n## Extra Github Actions\nYou can use following github action when using test buckets:\n```yaml\non:\n  push:\n\nname: \"push\"\njobs:\n  test:\n    strategy:\n      matrix:\n        platform: [ubuntu-latest]\n        bucket: [0, 1, 2, 3]\n    env:\n        TOTAL_BUCKETS: 4\n    runs-on: ${{ matrix.platform }}\n    steps:\n      -\n        name: Checkout code\n        uses: actions/checkout@v3.5.2\n      -\n        name: Get go.mod details\n        uses: Eun/go-mod-details@v1.0.6\n        id: go-mod-details\n      -\n        name: Install Go\n        uses: actions/setup-go@v4\n        with:\n          go-version: ${{ steps.go-mod-details.outputs.go_version }}\n      -\n        name: Test\n        run: go test -v -count=1 ./...\n        env:\n          BUCKET: ${{ matrix.bucket }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feun%2Fgo-test-buckets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feun%2Fgo-test-buckets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feun%2Fgo-test-buckets/lists"}