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/03/14 09:44:15 UTC

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

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



##########
File path: playground/backend/internal/executors/executor_builder_test.go
##########
@@ -0,0 +1,210 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package executors
+
+import (
+	"reflect"
+	"testing"
+)
+
+func TestNewExecutorBuilder(t *testing.T) {
+	tests := []struct {
+		name string
+		want *ExecutorBuilder
+	}{
+		{
+			name: "Get executor builder",
+			want: &ExecutorBuilder{},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			if got := NewExecutorBuilder(); !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("NewExecutorBuilder() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestExecutorBuilder_WithCompiler(t *testing.T) {
+	type fields struct {
+		actions []handler
+	}
+	tests := []struct {
+		name   string
+		fields fields
+		want   *CompileBuilder
+	}{
+		{
+			name:   "Get CompileBuilder with empty actions",
+			fields: fields{actions: []handler{}},
+			want:   &CompileBuilder{ExecutorBuilder{actions: []handler{}}},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			b := &ExecutorBuilder{
+				actions: tt.fields.actions,
+			}
+			if got := b.WithCompiler(); !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("WithCompiler() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestExecutorBuilder_WithRunner(t *testing.T) {
+	type fields struct {
+		actions []handler
+	}
+	tests := []struct {
+		name   string
+		fields fields
+		want   *RunBuilder
+	}{
+		{
+			name:   "Get RunBuilder with empty actions",
+			fields: fields{actions: []handler{}},
+			want:   &RunBuilder{ExecutorBuilder{actions: []handler{}}},
+		},
+	}
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			b := &ExecutorBuilder{
+				actions: tt.fields.actions,
+			}
+			if got := b.WithRunner(); !reflect.DeepEqual(got, tt.want) {
+				t.Errorf("WithRunner() = %v, want %v", got, tt.want)
+			}
+		})
+	}
+}
+
+func TestExecutorBuilder_WithValidator(t *testing.T) {
+	type fields struct {
+		actions []handler
+	}
+	tests := []struct {
+		name   string
+		fields fields
+		want   *ValidatorBuilder
+	}{
+		{
+			name:   "Get RunBuilder with empty actions",

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