> ## Documentation Index
> Fetch the complete documentation index at: https://site.aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# The ‘test' command

> Learn how the Bazel test command runs testable targets and how flags like --test_args, --test_env, and --test_output control runner behavior and log streaming.

In this section, you learn what the ` bazel test` command does and how you control test behavior in your Bazel projects.

## The  `bazel test` command

The `bazel test` command is used to execute all testable targets, and report whether each test passes or fails.
For example, to run all tests in the repository, use a target pattern:

```bash theme={null}
bazel test //...
```

## Controlling test execution

Control over the test process is largely left to your Bazel command-line flags.
This includes things like:

* `--test_args` - arguments to forward to the test runner's CLI.
* `--test_env` - which environment variables should be included in the test's inputs and cache key.
* `--test_output`
  * `--test_output=streamed` -  useful to say, "stream the log", so it's similar to watching the test runner CLI run.
  * `--test_output=errors` - typical to get Bazel to print the test failures to `stdout`, otherwise you can only get them from the log in `bazel-testlogs`.
