Skip to content

Commit

Permalink
test: fix e2e testsé
Browse files Browse the repository at this point in the history
Signed-off-by: ThibaultFy <[email protected]>
  • Loading branch information
ThibaultFy committed Dec 19, 2023
1 parent 5ee12f8 commit 9d5405d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions e2e/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2e/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion server/standalone/dbal/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9d5405d

Please sign in to comment.