diff --git a/bigquery/go.mod b/bigquery/go.mod index c1f46b3a44c..2a2359cd9c1 100644 --- a/bigquery/go.mod +++ b/bigquery/go.mod @@ -6,7 +6,6 @@ require ( cloud.google.com/go v0.104.0 cloud.google.com/go/datacatalog v1.5.0 cloud.google.com/go/iam v0.3.0 - cloud.google.com/go/run v0.1.2 cloud.google.com/go/storage v1.23.0 github.com/google/go-cmp v0.5.8 github.com/googleapis/gax-go/v2 v2.5.1 diff --git a/bigquery/go.sum b/bigquery/go.sum index d93ea2313eb..d90dc3984e2 100644 --- a/bigquery/go.sum +++ b/bigquery/go.sum @@ -94,8 +94,6 @@ cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpIm cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= -cloud.google.com/go/run v0.1.2 h1:Fah1y/Q1U8YclV6p2rte/b5JNBUbhBnQifO7k4eznRg= -cloud.google.com/go/run v0.1.2/go.mod h1:BWliZqXKsaBc+qFx5G13Mk4uQ02bX6ye8PDkiW4qyYo= cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index 3d1737a8aff..f2034978fb5 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -37,7 +37,6 @@ import ( "cloud.google.com/go/internal/pretty" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" - run "cloud.google.com/go/run/apiv2" "cloud.google.com/go/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -56,7 +55,6 @@ var record = flag.Bool("record", false, "record RPCs") var ( client *Client storageClient *storage.Client - functionsClient *run.ServicesClient connectionsClient *connection.Client policyTagManagerClient *datacatalog.PolicyTagManagerClient dataset *Dataset @@ -127,10 +125,6 @@ func initIntegrationTest() func() { if err != nil { log.Fatal(err) } - functionsClient, err = run.NewServicesClient(ctx, option.WithHTTPClient(hc)) - if err != nil { - log.Fatal(err) - } connectionsClient, err = connection.NewClient(ctx, option.WithHTTPClient(hc)) if err != nil { log.Fatal(err) @@ -152,7 +146,6 @@ func initIntegrationTest() func() { } client = nil storageClient = nil - functionsClient = nil connectionsClient = nil return func() {} @@ -217,10 +210,6 @@ func initIntegrationTest() func() { if err != nil { log.Fatalf("datacatalog.NewPolicyTagManagerClient: %v", err) } - functionsClient, err = run.NewServicesClient(ctx, sOpts...) - if err != nil { - log.Fatalf("run.NewService: %v", err) - } connectionsClient, err = connection.NewClient(ctx, sOpts...) if err != nil { log.Fatalf("connection.NewService: %v", err) diff --git a/bigquery/routine_integration_test.go b/bigquery/routine_integration_test.go index 744bdc73ed3..0208ec32a66 100644 --- a/bigquery/routine_integration_test.go +++ b/bigquery/routine_integration_test.go @@ -17,13 +17,11 @@ package bigquery import ( "context" "fmt" - "strings" "testing" "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" "google.golang.org/genproto/googleapis/cloud/bigquery/connection/v1" - "google.golang.org/genproto/googleapis/cloud/run/v2" ) func TestIntegration_RoutineScalarUDF(t *testing.T) { @@ -97,16 +95,9 @@ func TestIntegration_RoutineRemoteUDF(t *testing.T) { } ctx := context.Background() - functionLocation := fmt.Sprintf("projects/%s/locations/%s", dataset.ProjectID, "us-central1") routineID := routineIDs.New() routine := dataset.Routine(routineID) - - functionName := fmt.Sprintf("udf-func-%s", strings.ReplaceAll(routineID, "_", "-")) - cleanupFunction, uri, err := createCloudFunction(ctx, t, functionLocation, functionName) - if err != nil { - t.Fatal(err) - } - defer cleanupFunction() + uri := "https://aaabbbccc-uc.a.run.app" connectionLocation := fmt.Sprintf("projects/%s/locations/%s", dataset.ProjectID, "us") connectionName := fmt.Sprintf("udf_conn%s", routineID) @@ -144,47 +135,6 @@ func TestIntegration_RoutineRemoteUDF(t *testing.T) { } } -func createCloudFunction(ctx context.Context, t *testing.T, parent, functionName string) (cleanup func(), uri string, err error) { - fullname := fmt.Sprintf("%s/services/%s", parent, functionName) - createOps, err := functionsClient.CreateService(ctx, &run.CreateServiceRequest{ - Parent: parent, - ServiceId: functionName, - Service: &run.Service{ - Template: &run.RevisionTemplate{ - Containers: []*run.Container{ - { - Name: "hello", - Image: "gcr.io/cloudrun/hello", - }, - }, - }, - }, - }) - if err != nil { - return - } - _, err = createOps.Wait(ctx) - if err != nil { - return - } - service, err := functionsClient.GetService(ctx, &run.GetServiceRequest{ - Name: fullname, - }) - if err != nil { - return - } - cleanup = func() { - _, err := functionsClient.DeleteService(ctx, &run.DeleteServiceRequest{ - Name: fullname, - }) - if err != nil { - t.Logf("could not delete cloud run service: %s", fullname) - } - } - uri = service.GetUri() - return -} - func createConnection(ctx context.Context, t *testing.T, parent, name string) (cleanup func(), connectionID string, err error) { fullname := fmt.Sprintf("%s/connections/%s", parent, name) conn, err := connectionsClient.CreateConnection(ctx, &connection.CreateConnectionRequest{