Skip to content

Commit

Permalink
Allow build/test on the entire repo (#341)
Browse files Browse the repository at this point in the history
Clean up constraints and CI to allow running
all targets without the need to exclude subtrees
based on platform.
  • Loading branch information
luke-flow authored Sep 11, 2024
1 parent 988fe51 commit 9919d1d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ locally before attempting remote execution.
Build them all with:

```sh
bazel build -- //... -//platform/...
bazel build //...
```

- `swift`:
Expand All @@ -78,7 +78,7 @@ locally before attempting remote execution.
Test them all with:

```sh
bazel test -- //... -//platform/...
bazel test //...
```

- `swift`:
Expand Down Expand Up @@ -130,7 +130,7 @@ build --config=engflow
Build them all with:

```sh
bazel build -- //... -//platform/...
bazel build //...
```

- `swift`:
Expand All @@ -150,7 +150,7 @@ build --config=engflow
Test them all with:

```sh
bazel test -- //... -//platform/...
bazel test //...
```

- `swift`:
Expand Down
6 changes: 3 additions & 3 deletions docker/sysbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ Usage:
a container tha uses `sysbox` to run nested docker containers.

- Modify the `dind_test/BUILD`. Change the `container-image` attribute of the `sh_test`
rule to point the container you produced in the previous step.
rule to point the container you produced in the previous step.

- Modify the `.bazelrc` file at the top level of the repo to use your own endpoint.
- Modify the `.bazelrc` file at the top level of the repo to use your own endpoint.

- Run the following command:

```sh
bazel test --config=<your-cluster> --test_output=all //docker/sysbox/dind_test/...
bazel test --config=<your-cluster> --test_output=all //docker/sysbox/dind_test:check_docker
```

# How does it work?
Expand Down
3 changes: 2 additions & 1 deletion docker/sysbox/dind_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ sh_test(
# DO NOT ENABLE!!! "dockerPrivileged": "True",
# sysbox containers will refuse to start
},
)
tags = ["manual"]
)
16 changes: 2 additions & 14 deletions infra/test-all.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,7 @@
def main():
# All targets that can run in any environment.
targets = [
"//cpp/...",
"//docker/network/...",
"//docker/sandbox/...",
"//genrules/...",
"//go/...",
"//java/...",
"//kotlin/...",
"//scala/...",
"//typescript/...",
"//csharp/...",
"//perl/...",
"//python/...",
"//swift/...",
"//...",
]

for key in ("ARCH", "OPAL_RPC_CREDENTIALS", "OS", "REMOTE_EXECUTION"):
Expand All @@ -42,7 +30,7 @@ def main():
]
# The //docker/sysbox/... targets should only run in linux + remote
if os.getenv("REMOTE_EXECUTION") == "true" and os.getenv("OS") == "linux":
targets += ["//docker/sysbox/...",]
targets += ["//docker/sysbox/dind_test:check_docker",]
args = ["bazel", "test"] + flags + ["--"] + targets

result = subprocess.run(args)
Expand Down
3 changes: 3 additions & 0 deletions platform/linux_x64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ cc_toolchain_suite(
"k8|clang": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
},
target_compatible_with = [
"@platforms//os:linux",
],
)

cc_toolchain(
Expand Down
3 changes: 3 additions & 0 deletions platform/windows_x64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ cc_toolchain_suite(
"x64_windows|msvc": ":msvc_cc_toolchain",
"x64_windows": ":msvc_cc_toolchain",
},
target_compatible_with = [
"@platforms//os:windows",
],
)

cc_toolchain(
Expand Down

0 comments on commit 9919d1d

Please sign in to comment.