gotestyourself / gotestyourself/gotestsum

Split and group tests to run subsets in parallel

Open
#284 8 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
2.7k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

I would like to suggest a splitting feature to group tests to subsets and run them separately.

There is this tool: https://github.com/Songmu/gotesplit but I think it will be hard to make it work well with gotestsum.
I also tried working with `go test ./... -list=.` which should list all tests but the issue is that it runs `TestMain` and executes our init code for integration tests.

I really wish I could use gotestsum like gotesplit.

Something like:
```shell
# Run the first subset of three
gotestsum --split-subsets=3 --split-index=1
```

Or:
```
# Run the 3rd subset of five packages (with tests)
gotestsum --split-packages=5 --split-index=3
```

These could come in really handy to split integration tests to several jobs in the CI and thus shorten the dev cycle.
Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the requested gotestsum flags with gotesplit and the behavior of `go test ./... -list=.`; account for `TestMain` and integration-test init code. Done means subsets can be selected for tests or packages and run independently across CI jobs without relying on unsafe test discovery.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, cli, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.