Skip to content

Commit 6e189fc

Browse files
fix: test failures
Signed-off-by: nelson.parente <nelson_parente@live.com.pt>
1 parent e09ac0e commit 6e189fc

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

cmd/components.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var ComponentsCmd = &cobra.Command{
4242
}
4343
err := kubernetes.PrintComponents(componentsName, resourceNamespace, componentsOutputFormat)
4444
if err != nil {
45-
print.FailureStatusEvent(os.Stderr, err.Error())
45+
print.FailureStatusEvent(os.Stderr, "%s", err.Error())
4646
os.Exit(1)
4747
}
4848
}

pkg/kubernetes/kubernetes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func Init(config InitConfiguration) error {
122122
}
123123

124124
func installThirdPartyWithConsole(releaseName, chartName, releaseVersion, helmRepo string, prettyName string, chartValues []string, config InitConfiguration) error {
125-
installSpinning := print.Spinner(os.Stdout, "Deploying the "+prettyName+" with "+releaseVersion+" version to your cluster...")
125+
installSpinning := print.Spinner(os.Stdout, "Deploying the %s with %s version to your cluster...", prettyName, releaseVersion)
126126
defer installSpinning(print.Failure)
127127

128128
// releaseVersion of chart will always be latest version.
@@ -136,7 +136,7 @@ func installThirdPartyWithConsole(releaseName, chartName, releaseVersion, helmRe
136136
}
137137

138138
func installWithConsole(releaseName, releaseVersion, helmRepo string, prettyName string, config InitConfiguration) error {
139-
installSpinning := print.Spinner(os.Stdout, "Deploying the "+prettyName+" with "+releaseVersion+" version to your cluster...")
139+
installSpinning := print.Spinner(os.Stdout, "Deploying the %s with %s version to your cluster...", prettyName, releaseVersion)
140140
defer installSpinning(print.Failure)
141141

142142
err := install(releaseName, releaseVersion, helmRepo, config)

tests/e2e/kubernetes/run_template_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func startAppsWithTemplateFile(t *testing.T, runFilePath string) {
153153
"-k",
154154
}
155155
output, err := cmdRun(args...)
156-
t.Logf(output)
156+
t.Logf("%s", output)
157157
require.NoError(t, err, "run failed")
158158
assert.Contains(t, output, "Deploying service YAML")
159159
assert.Contains(t, output, "Deploying deployment YAML")

tests/e2e/standalone/run_template_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestRunWithTemplateFile(t *testing.T) {
6161
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
6262
defer cancel()
6363
output, err := cmdRunWithContext(ctx, "", args...)
64-
t.Logf(output)
64+
t.Logf("%s", output)
6565
require.NoError(t, err, "run failed")
6666
// Deterministic output for template file, so we can assert line by line
6767
lines := strings.Split(output, "\n")
@@ -110,7 +110,7 @@ func TestRunWithTemplateFile(t *testing.T) {
110110
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
111111
defer cancel()
112112
output, err := cmdRunWithContext(ctx, "", args...)
113-
t.Logf(output)
113+
t.Logf("%s", output)
114114
require.NoError(t, err, "run failed")
115115
// Deterministic output for template file, so we can assert line by line
116116
lines := strings.Split(output, "\n")
@@ -166,7 +166,7 @@ func TestRunWithTemplateFile(t *testing.T) {
166166
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
167167
defer cancel()
168168
output, err := cmdRunWithContext(ctx, "", args...)
169-
t.Logf(output)
169+
t.Logf("%s", output)
170170
require.NoError(t, err, "run failed")
171171
// Deterministic output for template file, so we can assert line by line
172172
lines := strings.Split(output, "\n")
@@ -216,7 +216,7 @@ func TestRunWithTemplateFile(t *testing.T) {
216216
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
217217
defer cancel()
218218
output, err := cmdRunWithContext(ctx, "", args...)
219-
t.Logf(output)
219+
t.Logf("%s", output)
220220
require.NoError(t, err, "run failed")
221221
// Deterministic output for template file, so we can assert line by line
222222
lines := strings.Split(output, "\n")
@@ -267,7 +267,7 @@ func TestRunWithTemplateFile(t *testing.T) {
267267
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
268268
defer cancel()
269269
output, err := cmdRunWithContext(ctx, "", args...)
270-
t.Logf(output)
270+
t.Logf("%s", output)
271271
require.Error(t, err, "run must fail")
272272
// Deterministic output for template file, so we can assert line by line
273273
lines := strings.Split(output, "\n")
@@ -315,7 +315,7 @@ func TestRunWithTemplateFile(t *testing.T) {
315315
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
316316
defer cancel()
317317
output, err := cmdRunWithContext(ctx, "", args...)
318-
t.Logf(output)
318+
t.Logf("%s", output)
319319
require.NoError(t, err, "run failed")
320320

321321
// App logs for processor app should not be printed to console and only written to file.
@@ -374,7 +374,7 @@ func TestRunTemplateFileWithoutDaprInit(t *testing.T) {
374374
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
375375
defer cancel()
376376
output, err := cmdRunWithContext(ctx, "", args...)
377-
t.Logf(output)
377+
t.Logf("%s", output)
378378
require.Error(t, err, "run must fail")
379379
assert.Contains(t, output, "Error starting Dapr and app (\"processor\"): fork/exec")
380380
assert.Contains(t, output, "daprd: no such file or directory")

tests/e2e/standalone/windows_run_template_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func startAppsWithValidRunTemplate(t *testing.T, file string) {
7878
"-f", file,
7979
}
8080
output, err := cmdRun("", args...)
81-
t.Logf(output)
81+
t.Logf("%s", output)
8282
require.NoError(t, err, "run failed")
8383
lines := strings.Split(output, "\n")
8484
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps")
@@ -97,7 +97,7 @@ func startAppsWithAppLogDestFile(t *testing.T, file string) {
9797
"-f", file,
9898
}
9999
output, err := cmdRun("", args...)
100-
t.Logf(output)
100+
t.Logf("%s", output)
101101
require.NoError(t, err, "run failed")
102102

103103
// App logs for processor app should not be printed to console and only written to file.
@@ -120,7 +120,7 @@ func startAppsWithAppLogDestConsole(t *testing.T, file string) {
120120
"-f", file,
121121
}
122122
output, err := cmdRun("", args...)
123-
t.Logf(output)
123+
t.Logf("%s", output)
124124
require.NoError(t, err, "run failed")
125125

126126
// App logs for processor app should be printed to console.

0 commit comments

Comments
 (0)