Skip to content

Commit 381969d

Browse files
committed
Migrate e2etests to bazel 9
This is a distinct bazel repository from base/cvd with fewer dependencies, so it is easier to migrate. The tools/bazel script is updated to not resolve symlinks when finding the `.bazelversion` path, so that the e2etests directory can still symlink `base/cvd/tools/bazel` and reuse it, while maintaining a separate `.bazelversion` file. Bug: b/477396584
1 parent 0ac2861 commit 381969d

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

base/cvd/tools/bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [ "${DISABLE_BAZEL_WRAPPER}" != "" ] \
4141
fi
4242

4343
# Read the bazel version from .bazelversion file in the root of the repository
44-
BAZELVERSION_FILE_PATH="$(dirname $(readlink -f "$0"))/../.bazelversion"
44+
BAZELVERSION_FILE_PATH="$(dirname "$0")/../.bazelversion"
4545
VERSION_FROM_BAZELVERSION_FILE=$(cat ${BAZELVERSION_FILE_PATH})
4646
VERSION=${OVERRIDE_BAZEL_VERSION:-${VERSION_FROM_BAZELVERSION_FILE}}
4747
cat << EOF >&2

e2etests/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.5.1
1+
9.0.0

e2etests/MODULE.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
bazel_dep(name = "gazelle", version = "0.40.0")
2-
bazel_dep(name = "rules_go", version = "0.50.1")
2+
bazel_dep(name = "rules_go", version = "0.59.0")
3+
bazel_dep(name = "rules_shell", version = "0.6.1")
34

45
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
56
go_sdk.download(version = "1.23.1")

e2etests/cvd/boot_tests.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
2+
13
def launch_cvd_boot_test(name, branch, target, credential_source = ""):
24
args = ["-b", branch, "-t", target]
35
if credential_source:
46
args += ["-c", credential_source]
5-
native.sh_test(
7+
sh_test(
68
name = name,
79
size = "medium",
810
srcs = ["launch_cvd_boot_test.sh"],
@@ -18,7 +20,7 @@ def cvd_load_boot_test(name, env_file, size = "medium", credential_source = ""):
1820
args = ["-e", "cvd/" + env_file]
1921
if credential_source:
2022
args += ["-c", credential_source]
21-
native.sh_test(
23+
sh_test(
2224
name = name,
2325
size = size,
2426
srcs = ["cvd_load_boot_test.sh"],
@@ -38,7 +40,7 @@ def cvd_command_boot_test(name, branch, target, cvd_command = [], credential_sou
3840
if substitutions:
3941
args += ["-s", ",".join(substitutions)]
4042
args += cvd_command
41-
native.sh_test(
43+
sh_test(
4244
name = name,
4345
size = "medium",
4446
srcs = ["cvd_command_boot_test.sh"],

e2etests/orchestration/artifacts/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
load("def.bzl", "aosp_artifact")
16+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
1617

1718
sh_binary(
1819
name = "fetch_aosp_artifact",

0 commit comments

Comments
 (0)