Skip to content

Commit

Permalink
Update HO API messages dependency in orchestration e2e tests.
Browse files Browse the repository at this point in the history
- Use `github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1`.
  • Loading branch information
ser-io committed Oct 15, 2024
1 parent 6021a97 commit 48e3800
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 16 deletions.
12 changes: 12 additions & 0 deletions e2etests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
15 changes: 13 additions & 2 deletions e2etests/go_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2etests/orchestration/create_local_image_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
4 changes: 2 additions & 2 deletions e2etests/orchestration/create_local_image_test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2etests/orchestration/create_single_instance_test/def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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{
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2etests/orchestration/snapshot_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
4 changes: 2 additions & 2 deletions e2etests/orchestration/snapshot_test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 48e3800

Please sign in to comment.