[
https://issues.apache.org/jira/browse/BEAM-13886?focusedWorklogId=732539&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-732539
]
ASF GitHub Bot logged work on BEAM-13886:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Feb/22 17:49
Start Date: 24/Feb/22 17:49
Worklog Time Spent: 10m
Work Description: lostluck commented on a change in pull request #16935:
URL: https://github.com/apache/beam/pull/16935#discussion_r814124049
##########
File path: sdks/go/pkg/beam/core/graph/window/trigger/trigger_test.go
##########
@@ -0,0 +1,59 @@
+// 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 trigger
+
+import (
+ "testing"
+ "time"
+)
+
+func TestAfterCount(t *testing.T) {
+ tr := AfterCount(1)
+ want := int32(1)
+ if got := tr.ElementCount(); got != want {
+ t.Errorf("element count not configured correctly. got %v, want
%v", got, want)
+ }
+}
+
+func TestAfterProcessingTime(t *testing.T) {
+ tr := AfterProcessingTime()
+ tr.PlusDelay(time.Millisecond).AlignedTo(time.Millisecond, time.Now())
+ want := 2
+ if got := len(tr.TimestampTransforms()); got != want {
+ t.Errorf("timestamp transforms not configured correctly. got
%v, want %v", got, want)
+ }
+}
+
+func TestRepeat(t *testing.T) {
+ subTr := AfterCount(1)
+ tr := Repeat(subTr)
+
+ if got := tr.SubTrigger(); got != subTr {
+ t.Errorf("subtrigger not configured correctly. got %v, want
%v", got, subTr)
+ }
+}
+
+func TestAfterEndOfWindow(t *testing.T) {
Review comment:
And ultimately, we can have sub tests, if we want grouping t.Run can be
executed just fine outside of a loop, and create arbitrary related sub tests.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 732539)
Time Spent: 1h 20m (was: 1h 10m)
> Add unit testing to the trigger package
> ---------------------------------------
>
> Key: BEAM-13886
> URL: https://issues.apache.org/jira/browse/BEAM-13886
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Jack McCluskey
> Assignee: Ritesh Ghorse
> Priority: P2
> Labels: starter
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Add basic unit testing to the [trigger
> package|https://github.com/apache/beam/tree/release-2.36.0/sdks/go/pkg/beam/core/graph/window/trigger]
> We want code coverage at or above 50%, it is currently at 0%.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)