bazel-contrib / bazel-contrib/rules_go

How can I use the build flag -p on tests

Open
#2,369 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

### What version of rules_go are you using?
1.13.4
### What version of gazelle are you using?
0.19.1
### What version of Bazel are you using?
2.0.0

How can I use the build flag -p on bazel test? My typical test command looks like:
`go test -parallel 1 -p 1 ./...`
I have converted bazel to be:
`bazel test //... --test_arg=-test.parallel=1`
But I cannot figure out get the -p flag in order to not execute multiple test packages at the same time. The `-p` flag is a build argument, https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies

Contributor guide

Open the contributing guide

Research direction

Start by comparing the reported `go test -parallel 1 -p 1 ./...` command with `bazel test //... --test_arg=-test.parallel=1`, focusing on how rules_go and Bazel handle package and test concurrency. Done means identifying and documenting or enabling the Bazel-equivalent behavior for limiting concurrent test packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.