Skip to content

Commit 504d4ea

Browse files
Removing preview feature for dapr run -f (#1348)
Signed-off-by: Pravin Pushkar <[email protected]>
1 parent 0c99afb commit 504d4ea

File tree

3 files changed

+45
-49
lines changed

3 files changed

+45
-49
lines changed

cmd/run.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) (
486486
// This is done to provide a better grouping, which can be used to control all the proceses started by "dapr run -f".
487487
daprsyscall.CreateProcessGroupID()
488488

489-
print.WarningStatusEvent(os.Stdout, "This is a preview feature and subject to change in future releases.")
490-
491489
for _, app := range apps {
492490
print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID)
493491
// Set defaults if zero value provided in config yaml.

tests/e2e/standalone/run_template_test.go

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ func TestRunWithTemplateFile(t *testing.T) {
6868
require.NoError(t, err, "run failed")
6969
// Deterministic output for template file, so we can assert line by line
7070
lines := strings.Split(output, "\n")
71-
assert.GreaterOrEqual(t, len(lines), 5, "expected at least 5 lines in output of starting two apps")
72-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
73-
assert.Contains(t, lines[3], "Writing log files to directory")
74-
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
75-
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
76-
assert.Contains(t, lines[6], "Writing log files to directory")
77-
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
71+
assert.GreaterOrEqual(t, len(lines), 4, "expected at least 4 lines in output of starting two apps")
72+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
73+
assert.Contains(t, lines[2], "Writing log files to directory")
74+
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
75+
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
76+
assert.Contains(t, lines[5], "Writing log files to directory")
77+
assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs")
7878
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
7979
appTestOutput := AppTestOutput{
8080
appID: "processor",
@@ -118,16 +118,15 @@ func TestRunWithTemplateFile(t *testing.T) {
118118
require.NoError(t, err, "run failed")
119119
// Deterministic output for template file, so we can assert line by line
120120
lines := strings.Split(output, "\n")
121-
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
122-
assert.Contains(t, lines[0], "This is a preview feature and subject to change in future releases.")
123-
assert.Contains(t, lines[1], "Validating config and starting app \"processor\"")
124-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
125-
assert.Contains(t, lines[3], "Writing log files to directory")
126-
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
127-
assert.Contains(t, lines[4], "Validating config and starting app \"emit-metrics\"")
128-
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
129-
assert.Contains(t, lines[6], "Writing log files to directory")
130-
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
121+
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps")
122+
assert.Contains(t, lines[0], "Validating config and starting app \"processor\"")
123+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
124+
assert.Contains(t, lines[2], "Writing log files to directory")
125+
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
126+
assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"")
127+
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
128+
assert.Contains(t, lines[5], "Writing log files to directory")
129+
assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs")
131130
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
132131
appTestOutput := AppTestOutput{
133132
appID: "processor",
@@ -176,13 +175,13 @@ func TestRunWithTemplateFile(t *testing.T) {
176175
require.NoError(t, err, "run failed")
177176
// Deterministic output for template file, so we can assert line by line
178177
lines := strings.Split(output, "\n")
179-
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
180-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
181-
assert.Contains(t, lines[3], "Writing log files to directory")
182-
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
183-
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
184-
assert.Contains(t, lines[6], "Writing log files to directory")
185-
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
178+
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps")
179+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
180+
assert.Contains(t, lines[2], "Writing log files to directory")
181+
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
182+
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
183+
assert.Contains(t, lines[5], "Writing log files to directory")
184+
assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs")
186185
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
187186
appTestOutput := AppTestOutput{
188187
appID: "processor",
@@ -227,14 +226,14 @@ func TestRunWithTemplateFile(t *testing.T) {
227226
require.NoError(t, err, "run failed")
228227
// Deterministic output for template file, so we can assert line by line
229228
lines := strings.Split(output, "\n")
230-
assert.GreaterOrEqual(t, len(lines), 8, "expected at least 8 lines in output of starting two apps with one app not having a command")
231-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
232-
assert.Contains(t, lines[3], "Writing log files to directory")
233-
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
234-
assert.Contains(t, lines[5], "No application command found for app \"emit-metrics\" present in")
235-
assert.Contains(t, lines[6], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
236-
assert.Contains(t, lines[7], "Writing log files to directory")
237-
assert.Contains(t, lines[7], "tests/apps/emit-metrics/.dapr/logs")
229+
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps with one app not having a command")
230+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
231+
assert.Contains(t, lines[2], "Writing log files to directory")
232+
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
233+
assert.Contains(t, lines[4], "No application command found for app \"emit-metrics\" present in")
234+
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
235+
assert.Contains(t, lines[6], "Writing log files to directory")
236+
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
238237
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
239238
appTestOutput := AppTestOutput{
240239
appID: "processor",
@@ -279,11 +278,11 @@ func TestRunWithTemplateFile(t *testing.T) {
279278
require.Error(t, err, "run must fail")
280279
// Deterministic output for template file, so we can assert line by line
281280
lines := strings.Split(output, "\n")
282-
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps with last app having an empty command")
283-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
284-
assert.Contains(t, lines[3], "Writing log files to directory")
285-
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
286-
assert.Contains(t, lines[5], "Error starting Dapr and app (\"emit-metrics\"): exec: no command")
281+
assert.GreaterOrEqual(t, len(lines), 5, "expected at least 5 lines in output of starting two apps with last app having an empty command")
282+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
283+
assert.Contains(t, lines[2], "Writing log files to directory")
284+
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
285+
assert.Contains(t, lines[4], "Error starting Dapr and app (\"emit-metrics\"): exec: no command")
287286
appTestOutput := AppTestOutput{
288287
appID: "processor",
289288
baseLogDirPath: "../../apps/processor/.dapr/logs",

tests/e2e/standalone/windows_run_template_test.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,15 @@ func startAppsWithValidRunTemplate(t *testing.T, file string) {
8383
t.Logf(output)
8484
require.NoError(t, err, "run failed")
8585
lines := strings.Split(output, "\n")
86-
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
87-
assert.Contains(t, lines[0], "This is a preview feature and subject to change in future releases.")
88-
assert.Contains(t, lines[1], "Validating config and starting app \"processor\"")
89-
assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
90-
assert.Contains(t, lines[3], "Writing log files to directory")
91-
assert.Contains(t, lines[3], "tests\\apps\\processor\\.dapr\\logs")
92-
assert.Contains(t, lines[4], "Validating config and starting app \"emit-metrics\"")
93-
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
94-
assert.Contains(t, lines[6], "Writing log files to directory")
95-
assert.Contains(t, lines[6], "tests\\apps\\emit-metrics\\.dapr\\logs")
86+
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps")
87+
assert.Contains(t, lines[0], "Validating config and starting app \"processor\"")
88+
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
89+
assert.Contains(t, lines[2], "Writing log files to directory")
90+
assert.Contains(t, lines[2], "tests\\apps\\processor\\.dapr\\logs")
91+
assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"")
92+
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
93+
assert.Contains(t, lines[5], "Writing log files to directory")
94+
assert.Contains(t, lines[5], "tests\\apps\\emit-metrics\\.dapr\\logs")
9695
}
9796

9897
func startAppsWithAppLogDestFile(t *testing.T, file string) {

0 commit comments

Comments
 (0)