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/09 12:58:16 UTC

[GitHub] [beam] pavel-avilov opened a new pull request #17050: [BEAM-13877] [Playground] Increase test coverage for the executors package

pavel-avilov opened a new pull request #17050:
URL: https://github.com/apache/beam/pull/17050


   [[BEAM-13877]](https://issues.apache.org/jira/browse/BEAM-13877)
   Add unit tests to increase test coverage for the executors package.
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
    - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
   


-- 
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



[GitHub] [beam] pabloem commented on pull request #17050: [BEAM-13877] [Playground] Increase test coverage for the executors package

Posted by GitBox <gi...@apache.org>.
pabloem commented on pull request #17050:
URL: https://github.com/apache/beam/pull/17050#issuecomment-1082333192


   lgtm thanks!


-- 
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



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

Posted by GitBox <gi...@apache.org>.
pavel-avilov commented on a change in pull request #17050:
URL: https://github.com/apache/beam/pull/17050#discussion_r825756568



##########
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{}}},

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



[GitHub] [beam] pabloem merged pull request #17050: [BEAM-13877] [Playground] Increase test coverage for the executors package

Posted by GitBox <gi...@apache.org>.
pabloem merged pull request #17050:
URL: https://github.com/apache/beam/pull/17050


   


-- 
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



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

Posted by GitBox <gi...@apache.org>.
KhaninArtur commented on a change in pull request #17050:
URL: https://github.com/apache/beam/pull/17050#discussion_r823697675



##########
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{}}},

Review comment:
       Can we add cases when `actions` are not empty for all these tests?

##########
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:
       ```suggestion
   			name:   "Get ValidatorBuilder with empty actions",
   ```




-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
pavel-avilov commented on pull request #17050:
URL: https://github.com/apache/beam/pull/17050#issuecomment-1062895530


   @ilya-kozyrev @KhaninArtur 


-- 
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