Skip to content

Commit c7d4503

Browse files
ah-f3alexellis
authored andcommitted
Fix up tests based on merge openfaas#624
Signed-off-by: Alistair Hey <[email protected]>
1 parent 608968f commit c7d4503

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

handlers/deploy_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ func Test_buildAnnotations_Empty_In_CreateRequest(t *testing.T) {
2727
t.Errorf("missing prometheus.io.scrape key")
2828
}
2929

30-
if v != "false" {
31-
t.Errorf("want: %s for annotation prometheus.io.scrape got: %s", "false", v)
30+
want := "false"
31+
if v != want {
32+
t.Errorf("want: %s for annotation prometheus.io.scrape got: %s", want, v)
3233
}
3334
}
3435

@@ -45,9 +46,9 @@ func Test_buildAnnotations_Premetheus_NotOverridden(t *testing.T) {
4546
if !ok {
4647
t.Errorf("missing prometheus.io.scrape key")
4748
}
48-
49-
if v != "true" {
50-
t.Errorf("want: %s for annotation prometheus.io.scrape got: %s", "true", v)
49+
want := "true"
50+
if v != want {
51+
t.Errorf("want: %s for annotation prometheus.io.scrape got: %s", want, v)
5152
}
5253
}
5354

pkg/controller/deployment_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func Test_newDeployment_PrometheusScrape_NotOverridden(t *testing.T) {
107107

108108
deployment := newDeployment(function, nil, secrets, factory)
109109

110-
if deployment.Spec.Template.Annotations["prometheus.io.scrape"] != "true" {
111-
t.Errorf("Annotation prometheus.io.scrape should be %s, was: %s", "true", deployment.Spec.Template.Annotations["prometheus.io.scrape"])
110+
want := "true"
111+
112+
if deployment.Spec.Template.Annotations["prometheus.io.scrape"] != want {
113+
t.Errorf("Annotation prometheus.io.scrape should be %s, was: %s", want, deployment.Spec.Template.Annotations["prometheus.io.scrape"])
112114
}
113115
}

0 commit comments

Comments
 (0)