From 504d4eadba60a668cee30411f1d8e06c5a93666e Mon Sep 17 00:00:00 2001 From: Pravin Pushkar Date: Wed, 27 Sep 2023 21:33:24 +0530 Subject: [PATCH] Removing preview feature for dapr run -f (#1348) Signed-off-by: Pravin Pushkar --- cmd/run.go | 2 - tests/e2e/standalone/run_template_test.go | 73 +++++++++---------- .../standalone/windows_run_template_test.go | 19 +++-- 3 files changed, 45 insertions(+), 49 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 65d3ed40b..f1491e305 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -486,8 +486,6 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) ( // This is done to provide a better grouping, which can be used to control all the proceses started by "dapr run -f". daprsyscall.CreateProcessGroupID() - print.WarningStatusEvent(os.Stdout, "This is a preview feature and subject to change in future releases.") - for _, app := range apps { print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID) // Set defaults if zero value provided in config yaml. diff --git a/tests/e2e/standalone/run_template_test.go b/tests/e2e/standalone/run_template_test.go index f656d679c..4ef006b61 100644 --- a/tests/e2e/standalone/run_template_test.go +++ b/tests/e2e/standalone/run_template_test.go @@ -68,13 +68,13 @@ func TestRunWithTemplateFile(t *testing.T) { require.NoError(t, err, "run failed") // Deterministic output for template file, so we can assert line by line lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 5, "expected at least 5 lines in output of starting two apps") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs") - assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") - assert.Contains(t, lines[6], "Writing log files to directory") - assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs") + assert.GreaterOrEqual(t, len(lines), 4, "expected at least 4 lines in output of starting two apps") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs") + assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") + assert.Contains(t, lines[5], "Writing log files to directory") + assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs") assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.") appTestOutput := AppTestOutput{ appID: "processor", @@ -118,16 +118,15 @@ func TestRunWithTemplateFile(t *testing.T) { require.NoError(t, err, "run failed") // Deterministic output for template file, so we can assert line by line lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps") - assert.Contains(t, lines[0], "This is a preview feature and subject to change in future releases.") - assert.Contains(t, lines[1], "Validating config and starting app \"processor\"") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs") - assert.Contains(t, lines[4], "Validating config and starting app \"emit-metrics\"") - assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") - assert.Contains(t, lines[6], "Writing log files to directory") - assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs") + assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps") + assert.Contains(t, lines[0], "Validating config and starting app \"processor\"") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs") + assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"") + assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") + assert.Contains(t, lines[5], "Writing log files to directory") + assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs") assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.") appTestOutput := AppTestOutput{ appID: "processor", @@ -176,13 +175,13 @@ func TestRunWithTemplateFile(t *testing.T) { require.NoError(t, err, "run failed") // Deterministic output for template file, so we can assert line by line lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs") - assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") - assert.Contains(t, lines[6], "Writing log files to directory") - assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs") + assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs") + assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") + assert.Contains(t, lines[5], "Writing log files to directory") + assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs") assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.") appTestOutput := AppTestOutput{ appID: "processor", @@ -227,14 +226,14 @@ func TestRunWithTemplateFile(t *testing.T) { require.NoError(t, err, "run failed") // Deterministic output for template file, so we can assert line by line lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 8, "expected at least 8 lines in output of starting two apps with one app not having a command") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs") - assert.Contains(t, lines[5], "No application command found for app \"emit-metrics\" present in") - assert.Contains(t, lines[6], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") - assert.Contains(t, lines[7], "Writing log files to directory") - assert.Contains(t, lines[7], "tests/apps/emit-metrics/.dapr/logs") + assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps with one app not having a command") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs") + assert.Contains(t, lines[4], "No application command found for app \"emit-metrics\" present in") + assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") + assert.Contains(t, lines[6], "Writing log files to directory") + assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs") assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.") appTestOutput := AppTestOutput{ appID: "processor", @@ -279,11 +278,11 @@ func TestRunWithTemplateFile(t *testing.T) { require.Error(t, err, "run must fail") // Deterministic output for template file, so we can assert line by line lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps with last app having an empty command") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs") - assert.Contains(t, lines[5], "Error starting Dapr and app (\"emit-metrics\"): exec: no command") + assert.GreaterOrEqual(t, len(lines), 5, "expected at least 5 lines in output of starting two apps with last app having an empty command") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs") + assert.Contains(t, lines[4], "Error starting Dapr and app (\"emit-metrics\"): exec: no command") appTestOutput := AppTestOutput{ appID: "processor", baseLogDirPath: "../../apps/processor/.dapr/logs", diff --git a/tests/e2e/standalone/windows_run_template_test.go b/tests/e2e/standalone/windows_run_template_test.go index 44c71bc03..28ccefed9 100644 --- a/tests/e2e/standalone/windows_run_template_test.go +++ b/tests/e2e/standalone/windows_run_template_test.go @@ -83,16 +83,15 @@ func startAppsWithValidRunTemplate(t *testing.T, file string) { t.Logf(output) require.NoError(t, err, "run failed") lines := strings.Split(output, "\n") - assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps") - assert.Contains(t, lines[0], "This is a preview feature and subject to change in future releases.") - assert.Contains(t, lines[1], "Validating config and starting app \"processor\"") - assert.Contains(t, lines[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.") - assert.Contains(t, lines[3], "Writing log files to directory") - assert.Contains(t, lines[3], "tests\\apps\\processor\\.dapr\\logs") - assert.Contains(t, lines[4], "Validating config and starting app \"emit-metrics\"") - assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") - assert.Contains(t, lines[6], "Writing log files to directory") - assert.Contains(t, lines[6], "tests\\apps\\emit-metrics\\.dapr\\logs") + assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 lines in output of starting two apps") + assert.Contains(t, lines[0], "Validating config and starting app \"processor\"") + assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.") + assert.Contains(t, lines[2], "Writing log files to directory") + assert.Contains(t, lines[2], "tests\\apps\\processor\\.dapr\\logs") + assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"") + assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.") + assert.Contains(t, lines[5], "Writing log files to directory") + assert.Contains(t, lines[5], "tests\\apps\\emit-metrics\\.dapr\\logs") } func startAppsWithAppLogDestFile(t *testing.T, file string) {