You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/02/28 06:26:32 UTC

[GitHub] [beam] pavel-avilov commented on a change in pull request #16946: [BEAM-13873] [Playground] Increase test coverage for the environment package

pavel-avilov commented on a change in pull request #16946:
URL: https://github.com/apache/beam/pull/16946#discussion_r815608441



##########
File path: playground/backend/internal/environment/environment_service_test.go
##########
@@ -308,3 +344,109 @@ func Test_getConfigFromJson(t *testing.T) {
 		})
 	}
 }
+
+func TestConfigureBeamEnvs(t *testing.T) {
+	workingDir := "./"
+	modDir := "/modDir"
+	goExecutorConfig := NewExecutorConfig(
+		"go",
+		"",
+		"go",
+		[]string{"build", "-o", "bin"},
+		[]string{},
+		[]string{"test", "-v"},
+	)
+	pythonExecutorConfig := NewExecutorConfig(
+		"",
+		"python3",
+		"pytest",
+		[]string{},
+		[]string{},
+		[]string{},
+	)
+	scioExecutorConfig := NewExecutorConfig(
+		"",
+		"sbt",
+		"sbt",
+		[]string{},
+		[]string{"runMain"},
+		[]string{},
+	)
+	type args struct {
+		workingDir string
+	}
+	tests := []struct {
+		name      string
+		args      args
+		want      *BeamEnvs
+		wantErr   bool
+		envsToSet map[string]string
+	}{
+		{
+			name:      "PREPARED_MOD_DIR not be specified in the environment for GO sdk",

Review comment:
       Done

##########
File path: playground/backend/internal/environment/application_test.go
##########
@@ -382,3 +382,39 @@ func TestApplicationEnvs_PipelinesFolder(t *testing.T) {
 		})
 	}
 }
+
+func TestNetworkEnvs_Protocol(t *testing.T) {
+	protocol := "HTTP"
+	type fields struct {
+		ip       string
+		port     int
+		protocol string
+	}
+	tests := []struct {
+		name   string
+		fields fields
+		want   string
+	}{
+		{
+			name: "All success",

Review comment:
       Done

##########
File path: playground/backend/internal/environment/application_test.go
##########
@@ -98,7 +98,7 @@ func TestCacheEnvs_Address(t *testing.T) {
 		want   string
 	}{
 		{
-			name: "all success",
+			name: "All success",

Review comment:
       Done

##########
File path: playground/backend/internal/environment/application_test.go
##########
@@ -63,7 +63,7 @@ func TestCacheEnvs_CacheType(t *testing.T) {
 		want   string
 	}{
 		{
-			name: "all success",
+			name: "All success",

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org