Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed Apr 25, 2024
1 parent ce4f70c commit ac1e5d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestFunctionReconciler_buildDeployment(t *testing.T) {
}

got := s.buildDeployment(buildDeploymentArgs{}, cfg{
runtimeBaseImage: "",
runtimeBaseImage: "some_image",
fn: FunctionConfig{
ResourceConfig: ResourceConfig{
Function: FunctionResourceConfig{
Expand Down Expand Up @@ -214,7 +214,7 @@ func TestFunctionReconciler_buildDeploymentWithResources(t *testing.T) {
s := systemState{instance: *tt.args.instance}

got := s.buildDeployment(buildDeploymentArgs{}, cfg{
runtimeBaseImage: "",
runtimeBaseImage: "some_image",
fn: FunctionConfig{
ResourceConfig: ResourceConfig{
Function: FunctionResourceConfig{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func assertSuccessfulFunctionDeployment(t *testing.T, resourceClient resource.Cl
instance: *function,
}

g.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(gomega.Equal(s.buildImageAddress(regPullAddr, "???")))
g.Expect(deployment.Spec.Template.Spec.Containers[0].Image).To(gomega.Equal(s.buildImageAddress(regPullAddr, "some_image")))
g.Expect(deployment.Spec.Template.Labels).To(gomega.HaveLen(8))
g.Expect(deployment.Spec.Template.Labels[serverlessv1alpha2.FunctionNameLabel]).To(gomega.Equal(function.Name))
g.Expect(deployment.Spec.Template.Labels[serverlessv1alpha2.PodAppNameLabel]).To(gomega.Equal(function.Name))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func TestGitOpsWithContinuousGitCheckout(t *testing.T) {
instance: *function,
}

expectedImage := s.buildImageAddress("localhost:32132", "some-image")
expectedImage := s.buildImageAddress("localhost:32132", "some_image")
g.Expect(deployment).To(gomega.Not(gomega.BeNil()))
g.Expect(deployment).To(haveSpecificContainer0Image(expectedImage))
g.Expect(deployment).To(haveLabelLen(8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func Test_calculateGitImageTag(t *testing.T) {
Runtime: "nodejs20",
},
},
want: "5e62e84b27afdcf23e9ea682a8ce44b693c4a3258e5b26bd038c60cd41eb60ee",
want: "5093e1e9a1b0c94c513bbec23b8291240ba988872353a024d1b0d5b2901d421c",
},
{
name: "should use runtimeOverride",
baseImage: "nodejs20:test",
baseImage: "nodejs18:test",
fn: &serverlessv1alpha2.Function{
ObjectMeta: metav1.ObjectMeta{
UID: "fn-uuid",
Expand All @@ -52,11 +52,11 @@ func Test_calculateGitImageTag(t *testing.T) {
RuntimeImageOverride: "nodejs20",
},
},
want: "5e62e84b27afdcf23e9ea682a8ce44b693c4a3258e5b26bd038c60cd41eb60ee",
want: "5093e1e9a1b0c94c513bbec23b8291240ba988872353a024d1b0d5b2901d421c",
},
{
name: "should use runtime when runtimeOverride is empty",
baseImage: "python39:test",
baseImage: "nodejs18:test",
fn: &serverlessv1alpha2.Function{
ObjectMeta: metav1.ObjectMeta{
UID: "fn-uuid",
Expand All @@ -72,7 +72,7 @@ func Test_calculateGitImageTag(t *testing.T) {
RuntimeImageOverride: "",
},
},
want: "5e62e84b27afdcf23e9ea682a8ce44b693c4a3258e5b26bd038c60cd41eb60ee",
want: "5093e1e9a1b0c94c513bbec23b8291240ba988872353a024d1b0d5b2901d421c",
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -112,7 +112,7 @@ func Test_calculateInlineImageTag(t *testing.T) {
},
},
},
want: "9f131e00ad3c6cfc5ca36f27df299eeeb2b08bcc4328782e79b69440b1b7aa2b",
want: "3773f4e6b48ccb71c2a43f4a7cbbeb98333701d823d8ff5917d8f7373c7abbcd",
},
{
name: "should use runtimeOverride",
Expand All @@ -138,7 +138,7 @@ func Test_calculateInlineImageTag(t *testing.T) {
},
},
},
want: "9f131e00ad3c6cfc5ca36f27df299eeeb2b08bcc4328782e79b69440b1b7aa2b",
want: "3773f4e6b48ccb71c2a43f4a7cbbeb98333701d823d8ff5917d8f7373c7abbcd",
},
{
name: "should use runtime instead of runtimeOverride",
Expand All @@ -164,7 +164,7 @@ func Test_calculateInlineImageTag(t *testing.T) {
},
},
},
want: "9f131e00ad3c6cfc5ca36f27df299eeeb2b08bcc4328782e79b69440b1b7aa2b",
want: "3773f4e6b48ccb71c2a43f4a7cbbeb98333701d823d8ff5917d8f7373c7abbcd",
},
}
for _, tt := range tests {
Expand Down

0 comments on commit ac1e5d6

Please sign in to comment.