From 4c8e1aefecea79bca0a54ddbab24db158828f382 Mon Sep 17 00:00:00 2001 From: William Johansson Date: Fri, 10 Jan 2025 10:51:15 +0100 Subject: [PATCH] fix(create): add missing nil error check in Etag test --- internal/aiptest/create/etag.go | 3 ++- .../example/freight/v1/freight_service_aiptest.pb.go | 6 ++++-- .../apiv1/aiplatformpb/metadata_service_aiptest.pb.go | 9 ++++++--- .../apiv1/aiplatformpb/tensorboard_service_aiptest.pb.go | 9 ++++++--- .../apiv1/gsuiteaddonspb/gsuiteaddons_aiptest.pb.go | 3 ++- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/internal/aiptest/create/etag.go b/internal/aiptest/create/etag.go index e0286ad3..75b28e75 100644 --- a/internal/aiptest/create/etag.go +++ b/internal/aiptest/create/etag.go @@ -29,7 +29,8 @@ var etagPopulated = suite.Test{ Resource: scope.Resource, Method: createMethod, Parent: "parent", - }.Generate(f, "created", "_", ":=") + }.Generate(f, "created", "err", ":=") + f.P(ident.AssertNilError, "(t, err)") f.P(ident.AssertCheck, "(t, created.Etag != \"\")") return nil }, diff --git a/proto/gen/einride/example/freight/v1/freight_service_aiptest.pb.go b/proto/gen/einride/example/freight/v1/freight_service_aiptest.pb.go index b411296b..be561a39 100644 --- a/proto/gen/einride/example/freight/v1/freight_service_aiptest.pb.go +++ b/proto/gen/einride/example/freight/v1/freight_service_aiptest.pb.go @@ -324,10 +324,11 @@ func (fx *FreightServiceShipperTestSuiteConfig) testCreate(t *testing.T) { if fx.IDGenerator != nil { userSetID = fx.IDGenerator() } - created, _ := fx.Service().CreateShipper(fx.Context(), &CreateShipperRequest{ + created, err := fx.Service().CreateShipper(fx.Context(), &CreateShipperRequest{ Shipper: fx.Create(), ShipperId: userSetID, }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) @@ -1003,11 +1004,12 @@ func (fx *FreightServiceSiteTestSuiteConfig) testCreate(t *testing.T) { if fx.IDGenerator != nil { userSetID = fx.IDGenerator() } - created, _ := fx.Service().CreateSite(fx.Context(), &CreateSiteRequest{ + created, err := fx.Service().CreateSite(fx.Context(), &CreateSiteRequest{ Parent: parent, Site: fx.Create(parent), SiteId: userSetID, }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) diff --git a/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/metadata_service_aiptest.pb.go b/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/metadata_service_aiptest.pb.go index 66e3a670..51ee3fab 100644 --- a/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/metadata_service_aiptest.pb.go +++ b/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/metadata_service_aiptest.pb.go @@ -257,10 +257,11 @@ func (fx *MetadataServiceArtifactTestSuiteConfig) testCreate(t *testing.T) { t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateArtifact(fx.Context(), &CreateArtifactRequest{ + created, err := fx.Service().CreateArtifact(fx.Context(), &CreateArtifactRequest{ Parent: parent, Artifact: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) @@ -781,10 +782,11 @@ func (fx *MetadataServiceContextTestSuiteConfig) testCreate(t *testing.T) { t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateContext(fx.Context(), &CreateContextRequest{ + created, err := fx.Service().CreateContext(fx.Context(), &CreateContextRequest{ Parent: parent, Context: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) @@ -1305,10 +1307,11 @@ func (fx *MetadataServiceExecutionTestSuiteConfig) testCreate(t *testing.T) { t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateExecution(fx.Context(), &CreateExecutionRequest{ + created, err := fx.Service().CreateExecution(fx.Context(), &CreateExecutionRequest{ Parent: parent, Execution: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) diff --git a/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/tensorboard_service_aiptest.pb.go b/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/tensorboard_service_aiptest.pb.go index dde1bbe6..38531609 100644 --- a/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/tensorboard_service_aiptest.pb.go +++ b/proto/gen/googleapis/aiplatform/apiv1/aiplatformpb/tensorboard_service_aiptest.pb.go @@ -749,10 +749,11 @@ func (fx *TensorboardServiceTensorboardExperimentTestSuiteConfig) testCreate(t * t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateTensorboardExperiment(fx.Context(), &CreateTensorboardExperimentRequest{ + created, err := fx.Service().CreateTensorboardExperiment(fx.Context(), &CreateTensorboardExperimentRequest{ Parent: parent, TensorboardExperiment: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) @@ -1283,10 +1284,11 @@ func (fx *TensorboardServiceTensorboardRunTestSuiteConfig) testCreate(t *testing t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateTensorboardRun(fx.Context(), &CreateTensorboardRunRequest{ + created, err := fx.Service().CreateTensorboardRun(fx.Context(), &CreateTensorboardRunRequest{ Parent: parent, TensorboardRun: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) @@ -1876,10 +1878,11 @@ func (fx *TensorboardServiceTensorboardTimeSeriesTestSuiteConfig) testCreate(t * t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateTensorboardTimeSeries(fx.Context(), &CreateTensorboardTimeSeriesRequest{ + created, err := fx.Service().CreateTensorboardTimeSeries(fx.Context(), &CreateTensorboardTimeSeriesRequest{ Parent: parent, TensorboardTimeSeries: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") }) diff --git a/proto/gen/googleapis/gsuiteaddons/apiv1/gsuiteaddonspb/gsuiteaddons_aiptest.pb.go b/proto/gen/googleapis/gsuiteaddons/apiv1/gsuiteaddonspb/gsuiteaddons_aiptest.pb.go index 225f9fe7..3157116a 100644 --- a/proto/gen/googleapis/gsuiteaddons/apiv1/gsuiteaddonspb/gsuiteaddons_aiptest.pb.go +++ b/proto/gen/googleapis/gsuiteaddons/apiv1/gsuiteaddonspb/gsuiteaddons_aiptest.pb.go @@ -348,10 +348,11 @@ func (fx *GSuiteAddOnsDeploymentTestSuiteConfig) testCreate(t *testing.T) { t.Run("etag populated", func(t *testing.T) { fx.maybeSkip(t) parent := fx.nextParent(t, false) - created, _ := fx.Service().CreateDeployment(fx.Context(), &CreateDeploymentRequest{ + created, err := fx.Service().CreateDeployment(fx.Context(), &CreateDeploymentRequest{ Parent: parent, Deployment: fx.Create(parent), }) + assert.NilError(t, err) assert.Check(t, created.Etag != "") })