Skip to content

Commit

Permalink
base tests fixes for compile
Browse files Browse the repository at this point in the history
Signed-off-by: gauron99 <[email protected]>
  • Loading branch information
gauron99 committed Nov 1, 2023
1 parent d6dc97f commit 770c255
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions pkg/functions/function_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,18 @@ func TestFunction_ImageWithDigest(t *testing.T) {
want: "image-registry.openshift-image-registry.svc.cluster.local:50000/default/bar@sha256:42",
},
}
//TODO: gauron99 - this is gonna need to be changed (probably) because:
// 1: imageDigest now doesnt have a dedicated structure member (resolved?)
// 2: is still fetched after pushing the Function (which is a temporary fix -- it really should be during build)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
f := Function{
Image: tt.fields.Image,
Deploy: DeploySpec{
ImageDigest: tt.fields.ImageDigest,
Build: BuildSpec{
Image: tt.fields.Image,
},
}
if got := f.ImageWithDigest(); got != tt.want {
t.Errorf("ImageWithDigest() = %v, want %v", got, tt.want)
if got := f.ImageNameWithDigest(tt.fields.ImageDigest); got != tt.want {
t.Errorf("ImageNameWithDigest(tt.fields.ImageDigest) = %v, want %v", got, tt.want)
}
})
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/knative/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ func TestIntegration(t *testing.T) {
// * environment variables starting which name starts with FUNC_TEST,
// * files under /etc/cm and /etc/sc.
// * application also prints the same info to stderr on startup
Image: "quay.io/mvasek/func-test-service",
ImageDigest: "sha256:2eca4de00d7569c8791634bdbb0c4d5ec8fb061b001549314591e839dabd5269",
Created: now,
Image: "quay.io/mvasek/func-test-service",
Created: now,
Deploy: fn.DeploySpec{
Namespace: namespace,
Labels: []fn.Label{{Key: ptr("my-label"), Value: ptr("my-label-value")}},
ImageDigest: "sha256:2eca4de00d7569c8791634bdbb0c4d5ec8fb061b001549314591e839dabd5269",
Namespace: namespace,
Labels: []fn.Label{{Key: ptr("my-label"), Value: ptr("my-label-value")}},
Options: fn.Options{
Scale: &fn.ScaleOptions{
Min: &minScale,
Expand Down

0 comments on commit 770c255

Please sign in to comment.