Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow build/test on the entire repo #341

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
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
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
Loading