mirror of https://github.com/dapr/cli.git
Removing preview feature for dapr run -f (#1348)
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com> Signed-off-by: Nikita Sarawgi <sarawgi.nikita@gmail.com>
This commit is contained in:
parent
b1cf6a4898
commit
c128733d96
|
|
@ -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".
|
// This is done to provide a better grouping, which can be used to control all the proceses started by "dapr run -f".
|
||||||
daprsyscall.CreateProcessGroupID()
|
daprsyscall.CreateProcessGroupID()
|
||||||
|
|
||||||
print.WarningStatusEvent(os.Stdout, "This is a preview feature and subject to change in future releases.")
|
|
||||||
|
|
||||||
for _, app := range apps {
|
for _, app := range apps {
|
||||||
print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID)
|
print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID)
|
||||||
// Set defaults if zero value provided in config yaml.
|
// Set defaults if zero value provided in config yaml.
|
||||||
|
|
|
||||||
|
|
@ -68,13 +68,13 @@ func TestRunWithTemplateFile(t *testing.T) {
|
||||||
require.NoError(t, err, "run failed")
|
require.NoError(t, err, "run failed")
|
||||||
// Deterministic output for template file, so we can assert line by line
|
// Deterministic output for template file, so we can assert line by line
|
||||||
lines := strings.Split(output, "\n")
|
lines := strings.Split(output, "\n")
|
||||||
assert.GreaterOrEqual(t, len(lines), 5, "expected at least 5 lines in output of starting two apps")
|
assert.GreaterOrEqual(t, len(lines), 4, "expected at least 4 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[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
|
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
|
||||||
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
||||||
assert.Contains(t, lines[6], "Writing log files to directory")
|
assert.Contains(t, lines[5], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
|
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.")
|
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
|
||||||
appTestOutput := AppTestOutput{
|
appTestOutput := AppTestOutput{
|
||||||
appID: "processor",
|
appID: "processor",
|
||||||
|
|
@ -118,16 +118,15 @@ func TestRunWithTemplateFile(t *testing.T) {
|
||||||
require.NoError(t, err, "run failed")
|
require.NoError(t, err, "run failed")
|
||||||
// Deterministic output for template file, so we can assert line by line
|
// Deterministic output for template file, so we can assert line by line
|
||||||
lines := strings.Split(output, "\n")
|
lines := strings.Split(output, "\n")
|
||||||
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
|
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 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[0], "Validating config and starting app \"processor\"")
|
||||||
assert.Contains(t, lines[1], "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], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
|
||||||
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
|
assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"")
|
||||||
assert.Contains(t, lines[4], "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], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
assert.Contains(t, lines[5], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[6], "Writing log files to directory")
|
assert.Contains(t, lines[5], "tests/apps/emit-metrics/.dapr/logs")
|
||||||
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.")
|
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
|
||||||
appTestOutput := AppTestOutput{
|
appTestOutput := AppTestOutput{
|
||||||
appID: "processor",
|
appID: "processor",
|
||||||
|
|
@ -176,13 +175,13 @@ func TestRunWithTemplateFile(t *testing.T) {
|
||||||
require.NoError(t, err, "run failed")
|
require.NoError(t, err, "run failed")
|
||||||
// Deterministic output for template file, so we can assert line by line
|
// Deterministic output for template file, so we can assert line by line
|
||||||
lines := strings.Split(output, "\n")
|
lines := strings.Split(output, "\n")
|
||||||
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
|
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 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[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
|
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
|
||||||
assert.Contains(t, lines[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
assert.Contains(t, lines[4], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
||||||
assert.Contains(t, lines[6], "Writing log files to directory")
|
assert.Contains(t, lines[5], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[6], "tests/apps/emit-metrics/.dapr/logs")
|
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.")
|
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
|
||||||
appTestOutput := AppTestOutput{
|
appTestOutput := AppTestOutput{
|
||||||
appID: "processor",
|
appID: "processor",
|
||||||
|
|
@ -227,14 +226,14 @@ func TestRunWithTemplateFile(t *testing.T) {
|
||||||
require.NoError(t, err, "run failed")
|
require.NoError(t, err, "run failed")
|
||||||
// Deterministic output for template file, so we can assert line by line
|
// Deterministic output for template file, so we can assert line by line
|
||||||
lines := strings.Split(output, "\n")
|
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.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[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
|
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
|
||||||
assert.Contains(t, lines[5], "No application command found for app \"emit-metrics\" present in")
|
assert.Contains(t, lines[4], "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[5], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
||||||
assert.Contains(t, lines[7], "Writing log files to directory")
|
assert.Contains(t, lines[6], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[7], "tests/apps/emit-metrics/.dapr/logs")
|
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.")
|
assert.Contains(t, output, "Received signal to stop Dapr and app processes. Shutting down Dapr and app processes.")
|
||||||
appTestOutput := AppTestOutput{
|
appTestOutput := AppTestOutput{
|
||||||
appID: "processor",
|
appID: "processor",
|
||||||
|
|
@ -279,11 +278,11 @@ func TestRunWithTemplateFile(t *testing.T) {
|
||||||
require.Error(t, err, "run must fail")
|
require.Error(t, err, "run must fail")
|
||||||
// Deterministic output for template file, so we can assert line by line
|
// Deterministic output for template file, so we can assert line by line
|
||||||
lines := strings.Split(output, "\n")
|
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.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[2], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
assert.Contains(t, lines[1], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "tests/apps/processor/.dapr/logs")
|
assert.Contains(t, lines[2], "tests/apps/processor/.dapr/logs")
|
||||||
assert.Contains(t, lines[5], "Error starting Dapr and app (\"emit-metrics\"): exec: no command")
|
assert.Contains(t, lines[4], "Error starting Dapr and app (\"emit-metrics\"): exec: no command")
|
||||||
appTestOutput := AppTestOutput{
|
appTestOutput := AppTestOutput{
|
||||||
appID: "processor",
|
appID: "processor",
|
||||||
baseLogDirPath: "../../apps/processor/.dapr/logs",
|
baseLogDirPath: "../../apps/processor/.dapr/logs",
|
||||||
|
|
|
||||||
|
|
@ -83,16 +83,15 @@ func startAppsWithValidRunTemplate(t *testing.T, file string) {
|
||||||
t.Logf(output)
|
t.Logf(output)
|
||||||
require.NoError(t, err, "run failed")
|
require.NoError(t, err, "run failed")
|
||||||
lines := strings.Split(output, "\n")
|
lines := strings.Split(output, "\n")
|
||||||
assert.GreaterOrEqual(t, len(lines), 7, "expected at least 7 lines in output of starting two apps")
|
assert.GreaterOrEqual(t, len(lines), 6, "expected at least 6 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[0], "Validating config and starting app \"processor\"")
|
||||||
assert.Contains(t, lines[1], "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], "Started Dapr with app id \"processor\". HTTP Port: 3510.")
|
assert.Contains(t, lines[2], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[3], "Writing log files to directory")
|
assert.Contains(t, lines[2], "tests\\apps\\processor\\.dapr\\logs")
|
||||||
assert.Contains(t, lines[3], "tests\\apps\\processor\\.dapr\\logs")
|
assert.Contains(t, lines[3], "Validating config and starting app \"emit-metrics\"")
|
||||||
assert.Contains(t, lines[4], "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], "Started Dapr with app id \"emit-metrics\". HTTP Port: 3511.")
|
assert.Contains(t, lines[5], "Writing log files to directory")
|
||||||
assert.Contains(t, lines[6], "Writing log files to directory")
|
assert.Contains(t, lines[5], "tests\\apps\\emit-metrics\\.dapr\\logs")
|
||||||
assert.Contains(t, lines[6], "tests\\apps\\emit-metrics\\.dapr\\logs")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func startAppsWithAppLogDestFile(t *testing.T, file string) {
|
func startAppsWithAppLogDestFile(t *testing.T, file string) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue