Skip to content
Open
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
57 changes: 41 additions & 16 deletions e2etests/cvd/launch_cvd_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,44 @@

load("@rules_go//go:def.bzl", "go_test")

go_test(
name = "launch_cvd_tests",
srcs = ["main_test.go"],
deps = [
"//cvd/common:common",
],
size = "large",
tags = [
"exclusive",
"external",
"no-sandbox",
"podcvd_excluded",
"requires_ab",
"supports-graceful-termination",
],
)
IMPORTPATH = "github.com/google/android-cuttlefish/e2etests/cvd/launch_cvd_tests"

# name -> (branch, target)
LAUNCH_CVD_TESTS = {
"git_main_phone": ("git_main", "aosp_cf_x86_64_only_phone-trunk_staging-userdebug"),
"aosp_main_phone": ("aosp-android-latest-release", "aosp_cf_x86_64_only_phone-userdebug"),
"aosp14_gsi_phone": ("aosp-android14-gsi", "aosp_cf_x86_64_phone-userdebug"),
"aosp13_gsi_phone": ("aosp-android13-gsi", "aosp_cf_x86_64_phone-userdebug"),
"aosp12_gsi_phone": ("aosp-android12-gsi", "aosp_cf_x86_64_phone-userdebug"),
"git_main_auto": ("git_main-throttled-nightly", "aosp_cf_x86_64_auto-trunk_staging-userdebug"),
"car16_auto": ("git_android16-car-release", "aosp_cf_x86_64_auto-userdebug"),
"car17_auto": ("git_android17-car-release", "aosp_cf_x86_64_auto-userdebug"),
"git_sw_car_dev_sdv_core": ("git_main-swcar-dev", "aosp_cf_x86_64_sdv_core-trunk_staging-userdebug"),
"git_sw_car_dev_sdv_media": ("git_main-swcar-dev", "aosp_cf_x86_64_sdv_media-trunk_staging-userdebug"),
"aosp11_gsi_phone": ("aosp-android11-gsi", "aosp_cf_x86_64_only_phone-userdebug"),
}

[
go_test(
name = name,
size = "large",
srcs = ["main_test.go"],
importpath = IMPORTPATH,
tags = [
"exclusive",
"external",
"no-sandbox",
"podcvd_excluded",
"requires_ab",
"supports-graceful-termination",
],
x_defs = {
IMPORTPATH + ".branch": branch,
IMPORTPATH + ".target": target,
},
deps = [
"//cvd/common",
],
)
for name, (branch, target) in LAUNCH_CVD_TESTS.items()
]
94 changes: 19 additions & 75 deletions e2etests/cvd/launch_cvd_tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,85 +20,29 @@ import (
"github.com/google/android-cuttlefish/e2etests/cvd/common"
)

// Injected at link time via `x_defs` in BUILD.bazel.
var (
branch string
target string
)

func TestLaunchCvd(t *testing.T) {
testcases := []struct {
name string
branch string
target string
}{
{
name: "GitMainPhone",
branch: "git_main",
target: "aosp_cf_x86_64_only_phone-trunk_staging-userdebug",
},
{
name: "AospMainPhone",
branch: "aosp-android-latest-release",
target: "aosp_cf_x86_64_only_phone-userdebug",
},
{
name: "Aosp14GsiPhone",
branch: "aosp-android14-gsi",
target: "aosp_cf_x86_64_phone-userdebug",
},
{
name: "Aosp13GsiPhone",
branch: "aosp-android13-gsi",
target: "aosp_cf_x86_64_phone-userdebug",
},
{
name: "Aosp12GsiPhone",
branch: "aosp-android12-gsi",
target: "aosp_cf_x86_64_phone-userdebug",
},
{
name: "GitMainAuto",
branch: "git_main-throttled-nightly",
target: "aosp_cf_x86_64_auto-trunk_staging-userdebug",
},
{
name: "Car16Auto",
branch: "git_android16-car-release",
target: "aosp_cf_x86_64_auto-userdebug",
},
{
name: "Car17Auto",
branch: "git_android17-car-release",
target: "aosp_cf_x86_64_auto-userdebug",
},
{
name: "GitSwCarDevSdvCore",
branch: "git_main-swcar-dev",
target: "aosp_cf_x86_64_sdv_core-trunk_staging-userdebug",
},
{
name: "GitSwCarDevSdvMedia",
branch: "git_main-swcar-dev",
target: "aosp_cf_x86_64_sdv_media-trunk_staging-userdebug",
},
{
name: "Aosp11GsiPhone",
branch: "aosp-android11-gsi",
target: "aosp_cf_x86_64_only_phone-userdebug",
},
if branch == "" || target == "" {
t.Fatalf("branch and target must be set via x_defs in BUILD.bazel (branch=%q, target=%q)", branch, target)
}
c := e2etests.TestContext{}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
c.SetUp(t)
defer c.TearDown()

if _, err := c.CVDFetch(e2etests.FetchArgs{
DefaultBuildBranch: tc.branch,
DefaultBuildTarget: tc.target,
}); err != nil {
t.Fatal(err)
}
c := e2etests.TestContext{}
c.SetUp(t)
defer c.TearDown()

if err := c.LaunchCVD(e2etests.CreateArgs{}); err != nil {
t.Fatal(err)
}
if _, err := c.CVDFetch(e2etests.FetchArgs{
DefaultBuildBranch: branch,
DefaultBuildTarget: target,
}); err != nil {
t.Fatal(err)
}

})
if err := c.LaunchCVD(e2etests.CreateArgs{}); err != nil {
t.Fatal(err)
}
}
12 changes: 11 additions & 1 deletion tools/testutils/runcvde2etests_configs/cvd.tests
Comment thread
ser-io marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@
//cvd/env_tests:env_tests_with_substitution
//cvd/graphics_tests/gfxstream_guest_angle_host_lavapipe:graphics_tests
//cvd/graphics_tests/gfxstream_guest_angle_host_swiftshader:graphics_tests
//cvd/launch_cvd_tests:launch_cvd_tests
//cvd/launch_cvd_tests:aosp11_gsi_phone
//cvd/launch_cvd_tests:aosp12_gsi_phone
//cvd/launch_cvd_tests:aosp13_gsi_phone
//cvd/launch_cvd_tests:aosp14_gsi_phone
//cvd/launch_cvd_tests:aosp_main_phone
//cvd/launch_cvd_tests:car16_auto
//cvd/launch_cvd_tests:car17_auto
//cvd/launch_cvd_tests:git_main_auto
//cvd/launch_cvd_tests:git_main_phone
//cvd/launch_cvd_tests:git_sw_car_dev_sdv_core
//cvd/launch_cvd_tests:git_sw_car_dev_sdv_media
//cvd/logs_tests:logs_tests
//cvd/media_tests/cts:media_tests
//cvd/media_tests/v4l2_stream_proxy/v4l2compliance:media_tests
Expand Down
Loading