Bazel integration tests get default repos from the actual WORKSPACE file.
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
We reference some repositories in WORKSPACE then we replace the reference in test harnesses. This is brittle and can lead to tests which do not match the repo version we actually use. Below is the case for rules_cc and shell test. The problem exists for Java and Python tests too. This will get worse as we move more code out of native and //tools and into external repos.
In WORKSPACE:
```
http_archive(
name = "rules_cc",
sha256 = "36fa66d4d49debd71d05fba55c1353b522e8caef4a20f8080a3d17cdda001d89",
strip_prefix = "rules_cc-0d5f3f2768c6ca2faca0079a997a97ce22997a0c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/0d5f3f2768c6ca2faca0079a997a97ce22997a0c.zip",
"https://github.com/bazelbuild/rules_cc/archive/0d5f3f2768c6ca2faca0079a997a97ce22997a0c.zip",
],
)
```
https://github.com/bazelbuild/bazel/blob/64239e0af91514bb89f4da07794149c58813ff74/src/test/shell/testenv.sh#L452
```
function add_rules_cc_to_workspace() {
cat >> "$1"<
Contributor guide
Assessment
This issue has not been assessed yet.