diff --git a/tests/e2e/common/common.go b/tests/e2e/common/common.go index e79b5a50c..a10fba8c0 100644 --- a/tests/e2e/common/common.go +++ b/tests/e2e/common/common.go @@ -57,7 +57,7 @@ const ( devZipkinReleaseName = "dapr-dev-zipkin" ) -var VersionWithScheduler = semver.MustParse("1.14.0") +var VersionWithScheduler = semver.MustParse("1.14.0-rc.1") type VersionDetails struct { RuntimeVersion string @@ -109,6 +109,13 @@ func GetVersionsFromEnv(t *testing.T, latest bool) (string, string) { return daprRuntimeVersion, daprDashboardVersion } +func GetRuntimeVersion(t *testing.T, latest bool) *semver.Version { + daprRuntimeVersion, _ := GetVersionsFromEnv(t, latest) + runtimeVersion, err := semver.NewVersion(daprRuntimeVersion) + require.NoError(t, err) + return runtimeVersion +} + func UpgradeTest(details VersionDetails, opts TestOptions) func(t *testing.T) { return func(t *testing.T) { daprPath := GetDaprPath() diff --git a/tests/e2e/standalone/run_test.go b/tests/e2e/standalone/run_test.go index c98d71f0e..d4260aa9e 100644 --- a/tests/e2e/standalone/run_test.go +++ b/tests/e2e/standalone/run_test.go @@ -21,6 +21,8 @@ import ( "runtime" "testing" + "github.com/dapr/cli/tests/e2e/common" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -35,9 +37,12 @@ func TestStandaloneRun(t *testing.T) { output, err := cmdProcess(ctx, "placement", t.Log, "--metrics-port", "9091", "--healthz-port", "8081") require.NoError(t, err) t.Log(output) - output, err = cmdProcess(ctx, "scheduler", t.Log, "--metrics-port", "9092", "--healthz-port", "8082") - require.NoError(t, err) - t.Log(output) + + if common.GetRuntimeVersion(t, false).GreaterThan(common.VersionWithScheduler) { + output, err = cmdProcess(ctx, "scheduler", t.Log, "--metrics-port", "9092", "--healthz-port", "8082") + require.NoError(t, err) + t.Log(output) + } } t.Cleanup(func() { // remove dapr installation after all tests in this function. @@ -68,7 +73,11 @@ func TestStandaloneRun(t *testing.T) { output, err := cmdRun(path, "--dapr-internal-grpc-port", "9999", "--", "bash", "-c", "echo test") t.Log(output) require.NoError(t, err, "run failed") - assert.Contains(t, output, "Internal gRPC server is running on :9999") + if common.GetRuntimeVersion(t, false).GreaterThan(common.VersionWithScheduler) { + assert.Contains(t, output, "Internal gRPC server is running on :9999") + } else { + assert.Contains(t, output, "Internal gRPC server is running on port 9999") + } assert.Contains(t, output, "Exited App successfully") assert.Contains(t, output, "Exited Dapr successfully") assert.NotContains(t, output, "Could not update sidecar metadata for cliPID")