Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ This is the source code for the Angular CLI and related build tooling. This guid
});
```
- **NEVER** use or fallback to `os.tmpdir()`. Bazel executes tests in hermetic sandboxes and sets `TEST_TMPDIR` to an isolated, sandboxed directory. Using `os.tmpdir()` can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox.
- **Unit Tests:**
- Run all unit tests: `pnpm bazel test //packages/...`
- Run a specific test target: `pnpm bazel test //packages/angular/build:test`
- Query test targets: `pnpm bazel query "tests(//packages/...)"`
- **Unit & Integration Tests:**
- Run all unit and integration tests: `pnpm bazel test //packages/...`
- Run a specific unit test target (e.g., `pnpm bazel test //packages/angular/build:test`). Note that package `:test` targets may exclude builder integration tests (such as specs under `**/builders/**/tests/**`).
- Run a specific builder integration test target (e.g., `pnpm bazel test //packages/angular/build:library_integration_tests` or `pnpm bazel test //packages/angular/build:application_integration_tests`).
- Query all test targets: `pnpm bazel query "tests(//packages/...)"`
- Find the exact test target for a specific spec file: `pnpm bazel query "kind(jasmine_test, rdeps(//packages/..., <path/to/file_spec.ts>))"`
- Focus specific tests when debugging: use `fdescribe()` and `fit()`. NEVER commit focused tests to the repository.
- Run tests without sharding when isolating or debugging: use `--config=no-sharding` with a specific test target (e.g., `pnpm bazel test //packages/angular/build:test --config=no-sharding`).
- Run tests without sharding when isolating or debugging: use `--config=no-sharding` with a specific test target (e.g., `pnpm bazel test //packages/angular/build:library_integration_tests --config=no-sharding`).
This disables test sharding (`--test_sharding_strategy=disabled`) and flaky test retries (`--flaky_test_attempts=1`).
This is especially useful when isolating test runs or debugging with focused tests (`fit`/`fdescribe`) to avoid empty shard failures and unnecessary re-runs.
Do not use this flag when running broad test suites (such as `//packages/...`), as executing tests without sharding takes significantly longer.
Expand Down
Loading