diff --git a/e2etests/README.md b/e2etests/README.md index fe5e499428..959d6ffccb 100644 --- a/e2etests/README.md +++ b/e2etests/README.md @@ -9,3 +9,15 @@ bazel run //:gazelle ``` bazel test --local_test_jobs=1 orchestration/... ``` + +### Adding a new Go dependency + +If adding `github.com/gorilla/websocket` + +``` +bazel run //:gazelle -- update-repos -to_macro=go_repositories.bzl%repos "github.com/gorilla/websocket" +``` + +``` +bazel run //:gazelle +``` diff --git a/e2etests/go_repositories.bzl b/e2etests/go_repositories.bzl index 389a7b22a9..16d9391387 100644 --- a/e2etests/go_repositories.bzl +++ b/e2etests/go_repositories.bzl @@ -163,6 +163,12 @@ def repos(): sum = "h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=", version = "v1.1.1", ) + go_repository( + name = "com_github_google_android_cuttlefish_frontend_src_host_orchestrator", + importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator", + sum = "h1:GyA/c0U7dGi1oWoMSmGF00UcsBJxv+eZAiO5qirM9Ak=", + version = "v0.0.0-20241011194822-c22ea981e7da", + ) go_repository( name = "com_github_google_android_cuttlefish_frontend_src_liboperator", importpath = "github.com/google/android-cuttlefish/frontend/src/liboperator", @@ -172,8 +178,7 @@ def repos(): go_repository( name = "com_github_google_cloud_android_orchestration", importpath = "github.com/google/cloud-android-orchestration", - sum = "h1:xjbFWQtTP+fSJo+SyY/YhWCeQocv/aGlSQAqjexVUa4=", - version = "v0.1.0-alpha.0.20240808173224-3579213f3c5c", + commit = "659cfda81568b44ccb1cdded948c64a1fc6e1b6e", ) go_repository( name = "com_github_google_go_cmp", @@ -211,6 +216,12 @@ def repos(): sum = "h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=", version = "v1.8.0", ) + go_repository( + name = "com_github_gorilla_websocket", + importpath = "github.com/gorilla/websocket", + sum = "h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=", + version = "v1.5.3", + ) go_repository( name = "com_github_grpc_ecosystem_grpc_gateway", importpath = "github.com/grpc-ecosystem/grpc-gateway", diff --git a/e2etests/orchestration/create_from_images_zip_test/BUILD.bazel b/e2etests/orchestration/create_from_images_zip_test/BUILD.bazel index ebaf1c01fb..4f55ea40c0 100644 --- a/e2etests/orchestration/create_from_images_zip_test/BUILD.bazel +++ b/e2etests/orchestration/create_from_images_zip_test/BUILD.bazel @@ -24,7 +24,7 @@ go_test( ], deps = [ "//orchestration/common", - "@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:api", + "@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api", "@com_github_google_cloud_android_orchestration//pkg/client", "@com_github_google_go_cmp//cmp", ], diff --git a/e2etests/orchestration/create_from_images_zip_test/main_test.go b/e2etests/orchestration/create_from_images_zip_test/main_test.go index a98fb542c5..1c174c6247 100644 --- a/e2etests/orchestration/create_from_images_zip_test/main_test.go +++ b/e2etests/orchestration/create_from_images_zip_test/main_test.go @@ -20,7 +20,7 @@ import ( "github.com/google/android-cuttlefish/e2etests/orchestration/common" - hoapi "github.com/google/android-cuttlefish/frontend/src/liboperator/api/v1" + hoapi "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1" "github.com/google/cloud-android-orchestration/pkg/client" "github.com/google/go-cmp/cmp" ) @@ -77,7 +77,7 @@ func TestInstance(t *testing.T) { EnvConfig: envConfig, } - got, createErr := srv.CreateCVD(createReq /* buildAPICredentials */, "") + got, createErr := srv.CreateCVD(createReq, client.BuildAPICredential{}) if err := common.DownloadHostBugReport(srv, group_name); err != nil { t.Errorf("failed creating bugreport: %s\n", err) diff --git a/e2etests/orchestration/create_local_image_test/BUILD.bazel b/e2etests/orchestration/create_local_image_test/BUILD.bazel index d1dbdec1b7..58bcf5d071 100644 --- a/e2etests/orchestration/create_local_image_test/BUILD.bazel +++ b/e2etests/orchestration/create_local_image_test/BUILD.bazel @@ -24,7 +24,7 @@ go_test( ], deps = [ "//orchestration/common", - "@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:api", + "@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api", "@com_github_google_cloud_android_orchestration//pkg/client", "@com_github_google_go_cmp//cmp", ], diff --git a/e2etests/orchestration/create_local_image_test/main_test.go b/e2etests/orchestration/create_local_image_test/main_test.go index bfc2aba124..6e1d263c7a 100644 --- a/e2etests/orchestration/create_local_image_test/main_test.go +++ b/e2etests/orchestration/create_local_image_test/main_test.go @@ -26,7 +26,7 @@ import ( "github.com/google/android-cuttlefish/e2etests/orchestration/common" - hoapi "github.com/google/android-cuttlefish/frontend/src/liboperator/api/v1" + hoapi "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1" "github.com/google/cloud-android-orchestration/pkg/client" "github.com/google/go-cmp/cmp" ) @@ -82,7 +82,7 @@ func TestInstance(t *testing.T) { EnvConfig: envConfig, } - got, createErr := srv.CreateCVD(createReq /* buildAPICredentials */, "") + got, createErr := srv.CreateCVD(createReq, client.BuildAPICredential{}) if err := common.DownloadHostBugReport(srv, group_name); err != nil { t.Errorf("failed creating bugreport: %s\n", err) diff --git a/e2etests/orchestration/create_single_instance_test/def.bzl b/e2etests/orchestration/create_single_instance_test/def.bzl index 8e3a901fb3..07e53467cf 100644 --- a/e2etests/orchestration/create_single_instance_test/def.bzl +++ b/e2etests/orchestration/create_single_instance_test/def.bzl @@ -28,7 +28,7 @@ def create_single_instance_test(name, build_id, build_target): deps = [ "//orchestration/common", "@com_github_google_cloud_android_orchestration//pkg/client", - "@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:api", + "@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api", "@com_github_google_go_cmp//cmp", ], ) diff --git a/e2etests/orchestration/create_single_instance_test/main_test.go b/e2etests/orchestration/create_single_instance_test/main_test.go index 2381b562ae..bad5718d62 100644 --- a/e2etests/orchestration/create_single_instance_test/main_test.go +++ b/e2etests/orchestration/create_single_instance_test/main_test.go @@ -20,8 +20,8 @@ import ( "github.com/google/android-cuttlefish/e2etests/orchestration/common" - hoapi "github.com/google/android-cuttlefish/frontend/src/liboperator/api/v1" - orchclient "github.com/google/cloud-android-orchestration/pkg/client" + hoapi "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1" + client "github.com/google/cloud-android-orchestration/pkg/client" "github.com/google/go-cmp/cmp" ) @@ -35,7 +35,7 @@ func TestCreateSingleInstance(t *testing.T) { }) buildID := os.Getenv("BUILD_ID") buildTarget := os.Getenv("BUILD_TARGET") - srv := orchclient.NewHostOrchestratorService(ctx.ServiceURL) + srv := client.NewHostOrchestratorService(ctx.ServiceURL) createReq := &hoapi.CreateCVDRequest{ CVD: &hoapi.CVD{ BuildSource: &hoapi.BuildSource{ @@ -49,7 +49,7 @@ func TestCreateSingleInstance(t *testing.T) { }, } - got, createErr := srv.CreateCVD(createReq, "") + got, createErr := srv.CreateCVD(createReq, client.BuildAPICredential{}) if err := common.DownloadHostBugReport(srv, "cvd"); err != nil { t.Errorf("failed creating bugreport: %s\n", err) diff --git a/e2etests/orchestration/snapshot_test/BUILD.bazel b/e2etests/orchestration/snapshot_test/BUILD.bazel index 6d3ec4ae18..78f7d6658c 100644 --- a/e2etests/orchestration/snapshot_test/BUILD.bazel +++ b/e2etests/orchestration/snapshot_test/BUILD.bazel @@ -24,7 +24,7 @@ go_test( ], deps = [ "//orchestration/common", - "@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:api", + "@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api", "@com_github_google_cloud_android_orchestration//pkg/client", "@com_github_google_go_cmp//cmp", ], diff --git a/e2etests/orchestration/snapshot_test/main_test.go b/e2etests/orchestration/snapshot_test/main_test.go index bd30883278..2b3e088de1 100644 --- a/e2etests/orchestration/snapshot_test/main_test.go +++ b/e2etests/orchestration/snapshot_test/main_test.go @@ -24,7 +24,7 @@ import ( "github.com/google/android-cuttlefish/e2etests/orchestration/common" - hoapi "github.com/google/android-cuttlefish/frontend/src/liboperator/api/v1" + hoapi "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1" "github.com/google/cloud-android-orchestration/pkg/client" "github.com/google/go-cmp/cmp" ) @@ -152,7 +152,7 @@ func createDevice(srv client.HostOrchestratorService, group_name, artifactsDir s return nil, err } createReq := &hoapi.CreateCVDRequest{EnvConfig: envConfig} - res, createErr := srv.CreateCVD(createReq /* buildAPICredentials */, "") + res, createErr := srv.CreateCVD(createReq, client.BuildAPICredential{}) if createErr != nil { if err := common.DownloadHostBugReport(srv, group_name); err != nil { log.Printf("error downloading cvd bugreport: %v", err)