From 9d5405ddf5c07fbceb9aa83cc86ccfe98e358ea4 Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Tue, 19 Dec 2023 16:49:57 +0100 Subject: [PATCH] =?UTF-8?q?test:=20fix=20e2e=20tests=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ThibaultFy --- e2e/client/client.go | 7 ++++--- e2e/function_test.go | 2 +- server/standalone/dbal/function.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/e2e/client/client.go b/e2e/client/client.go index c59ac1da..64189a06 100644 --- a/e2e/client/client.go +++ b/e2e/client/client.go @@ -544,10 +544,11 @@ func (c *TestClient) GetAssetCreationEvent(assetKey string) *asset.Event { return resp.Events[0] } -func (c *TestClient) UpdateFunction(functionRef string, name string) *asset.UpdateFunctionResponse { +func (c *TestClient) UpdateFunction(functionRef string, name string, image *asset.Addressable) *asset.UpdateFunctionResponse { param := &asset.UpdateFunctionParam{ - Key: c.ks.GetKey(functionRef), - Name: name, + Key: c.ks.GetKey(functionRef), + Name: name, + Image: image, } c.logger.Debug().Str("function key", c.ks.GetKey(functionRef)).Msg("UpdateFunction") resp, err := c.functionService.UpdateFunction(c.ctx, param) diff --git a/e2e/function_test.go b/e2e/function_test.go index a94c547f..3c8185da 100644 --- a/e2e/function_test.go +++ b/e2e/function_test.go @@ -131,7 +131,7 @@ func TestUpdateFunction(t *testing.T) { keyRef := "function_filter_simple" registeredFunction := appClient.RegisterFunction(client.DefaultSimpleFunctionOptions().WithKeyRef(keyRef)) - appClient.UpdateFunction(keyRef, "new function name") + appClient.UpdateFunction(keyRef, "new function name", registeredFunction.Image) expectedFunction := registeredFunction expectedFunction.Name = "new function name" diff --git a/server/standalone/dbal/function.go b/server/standalone/dbal/function.go index d70281e2..6e05cd43 100644 --- a/server/standalone/dbal/function.go +++ b/server/standalone/dbal/function.go @@ -69,7 +69,7 @@ func (d *DBAL) AddFunction(function *asset.Function) error { stmt := getStatementBuilder(). Insert("functions"). Columns("key", "channel", "name", "description", "archive_address", "permissions", "owner", "creation_date", "metadata", "status", "image_address"). - Values(function.Key, d.channel, function.Name, function.Description.StorageAddress, function.Archive.StorageAddress, function.Permissions, function.Owner, function.CreationDate.AsTime(), function.Metadata, function.Status.String(), imageStorageAdress) + Values(function.Key, d.channel, function.Name, function.Description.StorageAddress, function.Archive.StorageAddress, function.Permissions, function.Owner, function.CreationDate.AsTime(), function.Metadata, function.Status.String(), function.Image.StorageAddress) err = d.exec(stmt) if err != nil {