bazelbuild / bazelbuild/bazel

Test a single shard

Open
#28,819 2 comments 0 reactions 0 assignees View on GitHub
team-Core type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

Run a single test shard (or multiple specific shards), instead of all test shards for a test.

### Which category does this issue belong to?

~_No response_~

CLI

### What underlying problem are you trying to solve with this feature?

* Run one shard per CI job.
* Debug test interactions, by isolating and running a single shard.

### Which operating system are you running Bazel on?

_No response_

### What is the output of `bazel info release`?

_No response_

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

I tried setting `--test_env` to do this manually.

I get:

```
Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: TEST_TOTAL_SHARDS=0 and TEST_TOTAL_SHARDS=3
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the current behavior using --test_env and the TEST_TOTAL_SHARDS error, then trace the CLI path that handles test sharding. Define how selecting one or more specific shards should work and verify that a CI job can run only those shards without duplicate shard environment variables.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, cli, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.