{"id":16306069,"url":"https://github.com/songmu/gotesplit","last_synced_at":"2025-04-10T11:13:19.218Z","repository":{"id":38210285,"uuid":"303720475","full_name":"Songmu/gotesplit","owner":"Songmu","description":"Splits the testing in Go into a subset and run it. It is useful for the CI environment.","archived":false,"fork":false,"pushed_at":"2024-09-22T17:56:49.000Z","size":61,"stargazers_count":73,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T22:44:50.776Z","etag":null,"topics":["ci","go","golang","testing"],"latest_commit_sha":null,"homepage":"","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/Songmu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2020-10-13T13:56:24.000Z","updated_at":"2025-03-09T19:10:36.000Z","dependencies_parsed_at":"2024-06-19T06:11:37.466Z","dependency_job_id":"8d5943fa-5bd5-41ed-a354-dc1169818f89","html_url":"https://github.com/Songmu/gotesplit","commit_stats":{"total_commits":52,"total_committers":5,"mean_commits":10.4,"dds":0.1923076923076923,"last_synced_commit":"8526d218f6f796105cdf79091528bc8f8a985c2a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Fgotesplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Fgotesplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Fgotesplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Songmu%2Fgotesplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Songmu","download_url":"https://codeload.github.com/Songmu/gotesplit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208566,"owners_count":21065203,"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","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":["ci","go","golang","testing"],"created_at":"2024-10-10T21:09:32.169Z","updated_at":"2025-04-10T11:13:19.189Z","avatar_url":"https://github.com/Songmu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"gotesplit\n=======\n\n[![Test Status](https://github.com/Songmu/gotesplit/workflows/test/badge.svg?branch=main)][actions]\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/gotesplit)][PkgGoDev]\n\n[actions]: https://github.com/Songmu/gotesplit/actions?workflow=test\n[license]: https://github.com/Songmu/gotesplit/blob/main/LICENSE\n[PkgGoDev]: https://pkg.go.dev/github.com/Songmu/gotesplit\n\ngotesplit splits the testng in Go into a subset and run it\n\n## Usage\n\n```console\n% gotesplit [options] [pkgs...] [-- go-test-arguments...]\n```\n\n\n### Options\n\n```\n-total uint\n      total number of test splits (CIRCLE_NODE_TOTAL is used if set) (default 1)\n-index uint\n      zero-based index number of test splits (CIRCLE_NODE_INDEX is used if set) (default 0)\n-junit-dir\n       directory to store test result as a JUnit format (optional)\n```\n\n### Synopsis\n\n```console\n% gotesplit -total=10 -index=0 -- -v -short\ngo test -v -short -run ^(?:TestAA|TestBB)$\n```\n\n## Description\n\nThe gotesplit splits the testng in Go into a subset and run it.\n\nIt is very useful when you want to run tests in parallel in a CI environment.\n\n## Installation\n\n```console\n# Install the latest version. (Install it into ./bin/ by default).\n% curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s\n\n# Specify installation directory ($(go env GOPATH)/bin/) and version.\n% curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s -- -b $(go env GOPATH)/bin [vX.Y.Z]\n\n# In alpine linux (as it does not come with curl by default)\n% wget -O - -q https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s [vX.Y.Z]\n\n# go get\n% go get github.com/Songmu/gotesplit/cmd/gotesplit\n\n# aqua https://aquaproj.github.io/\n% aqua g -i Songmu/gotesplit\n```\n\n## Example\n\n### CircleCI\n\nWe don't need to specify the -total and -index flag on CircleCI because gotesplit reads the `CIRCLE_NODE_TOTAL` and `CIRCLE_NODE_INDEX` environment variables automatically.\n\n```yaml\n    parallelism: 5\n    docker:\n      - image: circleci/golang:1.15.3\n    steps:\n      - checkout\n      - run:\n          command: |\n            curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s\n            bin/gotesplit ./... -- -v\n```\n\n### GitHub Actions\n\n```yaml\nname: CI\non: [push, pull_request]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        parallelism: [3]\n        index: [0,1,2]\n    steps:\n      - uses: actions/setup-go@v4\n      - uses: actions/checkout@v3\n      - name: Run tests parallelly\n        run: |\n          curl -sfL https://raw.githubusercontent.com/Songmu/gotesplit/main/install.sh | sh -s\n          bin/gotesplit -total ${{ matrix.parallelism }} -index ${{ matrix.index }} ./... -- -v\n```\n\n## Author\n\n[Songmu](https://github.com/Songmu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongmu%2Fgotesplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsongmu%2Fgotesplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongmu%2Fgotesplit/lists"}