[ 
https://issues.apache.org/jira/browse/BEAM-6073?focusedWorklogId=166982&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-166982
 ]

ASF GitHub Bot logged work on BEAM-6073:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Nov/18 18:03
            Start Date: 16/Nov/18 18:03
    Worklog Time Spent: 10m 
      Work Description: swegner closed pull request #7068: [BEAM-6073] Remove 
use of assert package
URL: https://github.com/apache/beam/pull/7068
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/go/pkg/beam/io/databaseio/util_test.go 
b/sdks/go/pkg/beam/io/databaseio/util_test.go
index 2b4030107c9..2ce024de288 100644
--- a/sdks/go/pkg/beam/io/databaseio/util_test.go
+++ b/sdks/go/pkg/beam/io/databaseio/util_test.go
@@ -18,7 +18,6 @@
 package databaseio
 
 import (
-       "github.com/stretchr/testify/assert"
        "reflect"
        "testing"
        "time"
@@ -35,38 +34,48 @@ func Test_queryRecordMapperProvider(t *testing.T) {
        }
 
        mapper, err := newQueryMapper([]string{"id", "name", "random", 
"date_of_birth"}, nil, reflect.TypeOf(User{}))
-       if !assert.Nil(t, err) {
-               return
+       if err != nil {
+               t.Fatalf("Expected nil, but got: %#v", err)
        }
 
        aUser := &User{}
        record, err := mapper(reflect.ValueOf(aUser))
-       if !assert.Nil(t, err) {
-               return
+       if err != nil {
+               t.Fatalf("Expected nil, but got: %#v", err)
        }
        id, ok := record[0].(*int)
-       assert.True(t, ok)
+       if !ok {
+               t.Errorf("record[0].(*int) failed, it's a %T", record[0])
+       }
        *id = 10
 
        name, ok := record[1].(*string)
-       assert.True(t, ok)
+       if !ok {
+               t.Errorf("record[1].(*string) failed, it's a %T", record[1])
+       }
        *name = "test"
 
        random, ok := record[2].(*float64)
-       assert.True(t, ok)
+       if !ok {
+               t.Errorf("record[2].(*float64) failed, it's a %T", record[2])
+       }
        *random = 1.2
 
        dob, ok := record[3].(*time.Time)
-       assert.True(t, ok)
+       if !ok {
+               t.Errorf("record[3].(*time.Time) failed, it's a %T", record[3])
+       }
        now := time.Now()
        *dob = now
 
-       assert.EqualValues(t, &User{
+       if want := (&User{
                ID:          *id,
                DateOfBirth: *dob,
                NameTest:    *name,
                Random:      *random,
-       }, aUser)
+       }); !reflect.DeepEqual(aUser, want) {
+               t.Errorf("got %v, want %v", aUser, want)
+       }
 }
 
 func Test_writerRecordMapperProvider(t *testing.T) {
@@ -79,8 +88,8 @@ func Test_writerRecordMapperProvider(t *testing.T) {
        }
 
        mapper, err := newWriterRowMapper([]string{"id", "name", "random", 
"date_of_birth"}, reflect.TypeOf(User{}))
-       if !assert.Nil(t, err) {
-               return
+       if err != nil {
+               t.Fatalf("Expected nil, but got: %#v", err)
        }
        aUser := &User{
                ID:          2,
@@ -89,12 +98,19 @@ func Test_writerRecordMapperProvider(t *testing.T) {
                DateOfBirth: time.Now(),
        }
        record, err := mapper(reflect.ValueOf(aUser))
-       if !assert.Nil(t, err) {
-               return
+       if err != nil {
+               t.Fatalf("Expected nil, but got: %#v", err)
+       }
+       if record[0] != aUser.ID {
+               t.Errorf("got %v, want %v", record[0], aUser.ID)
+       }
+       if record[1] != aUser.NameTest {
+               t.Errorf("got %v, want %v", record[1], aUser.NameTest)
+       }
+       if record[2] != aUser.Random {
+               t.Errorf("got %v, want %v", record[2], aUser.Random)
+       }
+       if record[3] != aUser.DateOfBirth {
+               t.Errorf("got %v, want %v", record[3], aUser.DateOfBirth)
        }
-       assert.EqualValues(t, 2, record[0])
-       assert.EqualValues(t, "abc", record[1])
-       assert.EqualValues(t, 1.6, record[2])
-       assert.EqualValues(t, aUser.DateOfBirth, record[3])
-
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 166982)
    Time Spent: 1.5h  (was: 1h 20m)

> Go PostCommit Broken -> gogradle needs "github.com/stretchr/testify/assert" 
> dep.
> --------------------------------------------------------------------------------
>
>                 Key: BEAM-6073
>                 URL: https://issues.apache.org/jira/browse/BEAM-6073
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-go, test-failures
>            Reporter: Robert Burke
>            Assignee: Robert Burke
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> [https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/1676/]
> 16:41:13 ok github.com/apache/beam/sdks/go/pkg/beam/artifact 0.047s coverage: 
> 68.5% of statements
> 16:41:14 # github.com/apache/beam/sdks/go/pkg/beam/io/databaseio
> 16:41:14 
> .gogradle/project_gopath/src/github.com/apache/beam/sdks/go/pkg/beam/io/databaseio/util_test.go:21:2:
>  cannot find package "github.com/stretchr/testify/assert" in any of:
> 16:41:14 
> /home/jenkins/jenkins-slave/workspace/beam_PostCommit_Go_GradleBuild/src/sdks/go/.gogradle/project_gopath/src/github.com/apache/beam/sdks/go/vendor/github.com/stretchr/testify/assert
>  (vendor tree)
> 16:41:14 
> /home/jenkins/.gradle/go/binary/1.10/go/src/github.com/stretchr/testify/assert
>  (from $GOROOT)
> 16:41:14 
> /home/jenkins/jenkins-slave/workspace/beam_PostCommit_Go_GradleBuild/src/sdks/go/.gogradle/project_gopath/src/github.com/stretchr/testify/assert
>  (from $GOPATH)
> 16:41:14 FAIL github.com/apache/beam/sdks/go/pkg/beam/io/databaseio [setup 
> failed]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to