diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fb384ce8..285f2d437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Install Go uses: actions/setup-go@v1 with: - go-version: 1.13.x + go-version: 1.14.x - name: Run tests run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./... @@ -62,7 +62,7 @@ jobs: - name: Install Go uses: actions/setup-go@v1 with: - go-version: 1.13.x + go-version: 1.14.x - name: Publish release uses: goreleaser/goreleaser-action@v1 diff --git a/go.mod b/go.mod index ad2490355..976d89320 100644 --- a/go.mod +++ b/go.mod @@ -2,23 +2,21 @@ module github.com/nyaruka/mailroom require ( github.com/Masterminds/semver v1.5.0 - github.com/apex/log v1.0.0 - github.com/aws/aws-sdk-go v1.16.17 + github.com/apex/log v1.1.4 + github.com/aws/aws-sdk-go v1.30.17 github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13 - github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448 // indirect + github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/edganiukov/fcm v0.3.0 + github.com/edganiukov/fcm v0.4.0 github.com/fortytw2/leaktest v1.3.0 // indirect github.com/getsentry/raven-go v0.1.2-0.20190125112653-238ebd86338d // indirect github.com/go-chi/chi v3.3.3+incompatible - github.com/go-sql-driver/mysql v1.4.1 // indirect - github.com/golang/protobuf v1.3.2 + github.com/golang/protobuf v1.4.0 github.com/gomodule/redigo v2.0.0+incompatible - github.com/google/go-cmp v0.3.0 // indirect github.com/gorilla/schema v1.1.0 github.com/jmoiron/sqlx v1.2.0 - github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 // indirect - github.com/lib/pq v1.0.0 + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/lib/pq v1.4.0 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect github.com/mattn/go-sqlite3 v1.10.0 // indirect github.com/nyaruka/ezconf v0.2.1 @@ -27,17 +25,16 @@ require ( github.com/nyaruka/librato v1.0.0 github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d github.com/nyaruka/null v1.2.0 - github.com/olivere/elastic v6.2.21+incompatible + github.com/olivere/elastic v6.2.30+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 github.com/prometheus/client_model v0.2.0 github.com/prometheus/common v0.9.1 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 - github.com/sirupsen/logrus v1.4.2 + github.com/sirupsen/logrus v1.5.0 github.com/stretchr/testify v1.5.1 - google.golang.org/appengine v1.4.0 // indirect gopkg.in/go-playground/validator.v9 v9.31.0 gopkg.in/mail.v2 v2.3.1 ) -go 1.13 +go 1.14 diff --git a/go.sum b/go.sum index b3e6b43e7..c53ab1f68 100644 --- a/go.sum +++ b/go.sum @@ -6,29 +6,37 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antlr/antlr4 v0.0.0-20200417160354-8c50731894e0 h1:j7MyDjg6pb7A2ziow17FDZ2Oj5vGnJsLyDmjpN4Jkcg= github.com/antlr/antlr4 v0.0.0-20200417160354-8c50731894e0/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y= -github.com/apex/log v1.0.0 h1:5UWeZC54mWVtOGSCjtuvDPgY/o0QxmjQgvYZ27pLVGQ= -github.com/apex/log v1.0.0/go.mod h1:yA770aXIDQrhVOIGurT/pVdfCpSq1GQV/auzMN5fzvY= -github.com/aws/aws-sdk-go v1.16.17 h1:hHRKZhoB4qEY17aGNp71UxQFyYpx6WZXGMUzx9y/A4w= -github.com/aws/aws-sdk-go v1.16.17/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/apex/log v1.1.4 h1:3Zk+boorIQAAGBrHn0JUtAau4ihMamT4WdnfdnXM1zQ= +github.com/apex/log v1.1.4/go.mod h1:AlpoD9aScyQfJDVHmLMEcx4oU6LqzkWp4Mg9GdAcEvQ= +github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= +github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= +github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= +github.com/aws/aws-sdk-go v1.20.6 h1:kmy4Gvdlyez1fV4kw5RYxZzWKVyuHZHgPWeU/YvRsV4= +github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.30.17 h1:Y8cyVjc7RWSJwt9uymwnsKZI4qnmamMkfYJJ806wHtA= +github.com/aws/aws-sdk-go v1.30.17/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/blevesearch/segment v0.9.0 h1:5lG7yBCx98or7gK2cHMKPukPZ/31Kag7nONpoBt22Ac= github.com/blevesearch/segment v0.9.0/go.mod h1:9PfHYUdQCgHktBgvtUOF4x+pc4/l8rdH0u5spnW85UQ= github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13 h1:+qUNY4VRkEH46bLUwxCyUU+iOGJMQBVibAaYzWiwWcg= github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13/go.mod h1:tgcrVJ81GPSF0mz+0nu1Xaz0fazGPrmmJfJtxjbHhUQ= -github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448 h1:8tNk6SPXzLDnATTrWoI5Bgw9s/x4uf0kmBpk21NZgI4= -github.com/certifi/gocertifi v0.0.0-20190105021004-abcd57078448/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= +github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 h1:JLaf/iINcLyjwbtTsCJjc6rtlASgHeIJPrB6QmwURnA= +github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/edganiukov/fcm v0.3.0 h1:eyumQdH5vYSfDRtI6RMGcXZDSXtknKtLTqepGDHVY5k= -github.com/edganiukov/fcm v0.3.0/go.mod h1:l759flQrpSpF8m2UGagmlnMOdWX1i1QtB4x48hUFiYI= +github.com/edganiukov/fcm v0.4.0 h1:PAZamwbiW2AegM5hGqYNv+djE1xxLyH7zMN6MwWpvoQ= +github.com/edganiukov/fcm v0.4.0/go.mod h1:3gL1BLvC3w05anUsF2Wbd1Sz+ZdCu8qsNCa1LyRfwFo= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/getsentry/raven-go v0.1.2-0.20190125112653-238ebd86338d h1:CIp8WnfXz70wJVQ0ytr3dswFYGoJbAxWgNvaLpiu3sY= github.com/getsentry/raven-go v0.1.2-0.20190125112653-238ebd86338d/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/go-chi/chi v3.3.3+incompatible h1:KHkmBEMNkwKuK4FdQL7N2wOeB9jnIx7jR5wsuSBEFI8= @@ -44,8 +52,8 @@ github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTM github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -55,16 +63,30 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= @@ -75,19 +97,26 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.4.0 h1:TmtCFbH+Aw0AixwyttznSMQDgbR5Yed/Gg6S8Funrhc= +github.com/lib/pq v1.4.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -110,8 +139,10 @@ github.com/nyaruka/null v1.2.0/go.mod h1:HSAFbLNOaEhHnoU0VCveCPz0GDtJ3GEtFWhvnBN github.com/nyaruka/phonenumbers v1.0.34/go.mod h1:GQ0cTHlrxPrhoLwyQ1blyN1hO794ygt6FTHWrFB5SSc= github.com/nyaruka/phonenumbers v1.0.55 h1:bj0nTO88Y68KeUQ/n3Lo2KgK7lM1hF7L9NFuwcCl3yg= github.com/nyaruka/phonenumbers v1.0.55/go.mod h1:sDaTZ/KPX5f8qyV9qN+hIm+4ZBARJrupC6LuhshJq1U= -github.com/olivere/elastic v6.2.21+incompatible h1:QnTuofzxOCV5FrYLywjkMxOmOWhAeild1VXxKRksK9Y= -github.com/olivere/elastic v6.2.21+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= +github.com/olivere/elastic v6.2.30+incompatible h1:9JdhoNFfUF809qM1S5WLz3CZaxazd/mDty9XXwDRz4Q= +github.com/olivere/elastic v6.2.30+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= @@ -133,6 +164,8 @@ github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v0.0.0-20180319170823-2df3e6ddaf6e/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= @@ -141,6 +174,11 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= +github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= +github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= @@ -151,20 +189,31 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= +github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= +github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= +github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd h1:QPwSajcTUrFriMF1nJ3XzgoqakqQEsnZf9LdXdi2nkI= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= @@ -174,8 +223,14 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= @@ -183,12 +238,14 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk= gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/hooks/airtime_transferred_test.go b/hooks/airtime_transferred_test.go index 0fb1e701a..be800da17 100644 --- a/hooks/airtime_transferred_test.go +++ b/hooks/airtime_transferred_test.go @@ -90,12 +90,12 @@ func TestAirtimeTransferred(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: `select count(*) from airtime_airtimetransfer where org_id = $1 AND contact_id = $2 AND status = 'S'`, Args: []interface{}{models.Org1, models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from request_logs_httplog where org_id = $1 AND airtime_transfer_id IS NOT NULL AND is_error = FALSE AND url = 'https://airtime-api.dtone.com/cgi-bin/shop/topup'`, Args: []interface{}{models.Org1}, Count: 3, @@ -109,12 +109,12 @@ func TestAirtimeTransferred(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: `select count(*) from airtime_airtimetransfer where org_id = $1 AND contact_id = $2 AND status = 'F'`, Args: []interface{}{models.Org1, models.GeorgeID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from request_logs_httplog where org_id = $1 AND airtime_transfer_id IS NOT NULL AND is_error = TRUE AND url = 'https://airtime-api.dtone.com/cgi-bin/shop/topup'`, Args: []interface{}{models.Org1}, Count: 1, diff --git a/hooks/broadcast_created_test.go b/hooks/broadcast_created_test.go index 48fb1718e..a1901e103 100644 --- a/hooks/broadcast_created_test.go +++ b/hooks/broadcast_created_test.go @@ -28,7 +28,7 @@ func TestBroadcastCreated(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from flows_flowrun where contact_id = $1 AND is_active = FALSE", Args: []interface{}{models.CathyID}, Count: 1, diff --git a/hooks/campaigns_test.go b/hooks/campaigns_test.go index b3c837d0a..07443d0a3 100644 --- a/hooks/campaigns_test.go +++ b/hooks/campaigns_test.go @@ -55,17 +55,17 @@ func TestCampaigns(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: `select count(*) FROM campaigns_eventfire WHERE contact_id = $1`, Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) FROM campaigns_eventfire WHERE contact_id = $1`, Args: []interface{}{models.BobID}, Count: 3, }, - SQLAssertion{ + { SQL: `select count(*) FROM campaigns_eventfire WHERE contact_id = $1`, Args: []interface{}{models.GeorgeID}, Count: 0, diff --git a/hooks/classifier_called_test.go b/hooks/classifier_called_test.go index 8bc1701f0..5e5b10ba5 100644 --- a/hooks/classifier_called_test.go +++ b/hooks/classifier_called_test.go @@ -29,7 +29,7 @@ func TestClassifierCalled(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: `select count(*) from request_logs_httplog where org_id = $1 AND is_error = FALSE AND classifier_id = $2 AND url = 'https://api.wit.ai/message?v=20170307&q=book+me+a+flight'`, Args: []interface{}{models.Org1, models.WitID}, Count: 1, diff --git a/hooks/contact_field_changed_test.go b/hooks/contact_field_changed_test.go index 7e00ae369..fd106b901 100644 --- a/hooks/contact_field_changed_test.go +++ b/hooks/contact_field_changed_test.go @@ -43,42 +43,42 @@ func TestContactFieldChanged(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND fields->$2 = '{"text":"Female"}'::jsonb`, Args: []interface{}{models.CathyID, models.GenderFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND NOT fields?$2`, Args: []interface{}{models.CathyID, models.AgeFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND NOT fields?$2`, Args: []interface{}{models.GeorgeID, models.GenderFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND fields->$2 = '{"text":"40", "number": 40}'::jsonb`, Args: []interface{}{models.GeorgeID, models.AgeFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND fields->$2 = '{"text":"Male"}'::jsonb`, Args: []interface{}{models.BobID, models.GenderFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND fields->$2 = '{"text":"Old"}'::jsonb`, Args: []interface{}{models.BobID, models.AgeFieldUUID}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND NOT fields?$2`, Args: []interface{}{models.BobID, "unknown"}, Count: 1, }, - SQLAssertion{ + { SQL: `select count(*) from contacts_contact where id = $1 AND fields = '{}'`, Args: []interface{}{models.AlexandriaID}, Count: 1, diff --git a/hooks/contact_groups_changed_test.go b/hooks/contact_groups_changed_test.go index 4f2fc5558..db4b4baca 100644 --- a/hooks/contact_groups_changed_test.go +++ b/hooks/contact_groups_changed_test.go @@ -29,22 +29,22 @@ func TestContactGroupsChanged(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from contacts_contactgroup_contacts where contact_id = $1 and contactgroup_id = $2", Args: []interface{}{models.CathyID, models.DoctorsGroupID}, Count: 0, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contactgroup_contacts where contact_id = $1 and contactgroup_id = $2", Args: []interface{}{models.CathyID, models.TestersGroupID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contactgroup_contacts where contact_id = $1 and contactgroup_id = $2", Args: []interface{}{models.GeorgeID, models.TestersGroupID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contactgroup_contacts where contact_id = $1 and contactgroup_id = $2", Args: []interface{}{models.BobID, models.TestersGroupID}, Count: 0, diff --git a/hooks/contact_language_changed_test.go b/hooks/contact_language_changed_test.go index b88d6abd5..e750dfd96 100644 --- a/hooks/contact_language_changed_test.go +++ b/hooks/contact_language_changed_test.go @@ -21,17 +21,17 @@ func TestContactLanguageChanged(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where id = $1 and language = 'eng'", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where id = $1 and language = 'spa'", Args: []interface{}{models.GeorgeID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where id = $1 and language is NULL;", Args: []interface{}{models.BobID}, Count: 1, diff --git a/hooks/contact_name_changed_test.go b/hooks/contact_name_changed_test.go index bf3719fb3..ebb8cdc93 100644 --- a/hooks/contact_name_changed_test.go +++ b/hooks/contact_name_changed_test.go @@ -24,26 +24,26 @@ func TestContactNameChanged(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where name = 'Tarzan' and id = $1", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where name = 'Tarzan'", Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where name = 'Bob' and id = $1", Args: []interface{}{models.BobID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where name = 'Geoff Newman' and id = $1", Args: []interface{}{models.GeorgeID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where name = '😃2345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678' and id = $1", Args: []interface{}{models.AlexandriaID}, Count: 1, diff --git a/hooks/contact_urns_changed_test.go b/hooks/contact_urns_changed_test.go index e55af2e8a..b4f308f99 100644 --- a/hooks/contact_urns_changed_test.go +++ b/hooks/contact_urns_changed_test.go @@ -31,29 +31,29 @@ func TestAddContactURN(t *testing.T) { models.GeorgeID: []flows.Action{}, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from contacts_contacturn where contact_id = $1 and scheme = 'telegram' and path = '11551' and priority = 998", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contacturn where contact_id = $1 and scheme = 'tel' and path = '+12065551212' and priority = 999 and identity = 'tel:+12065551212'", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from contacts_contacturn where contact_id = $1 and scheme = 'tel' and path = '+16055741111' and priority = 1000", Args: []interface{}{models.CathyID}, Count: 1, }, // evan lost his 206 URN - SQLAssertion{ + { SQL: "select count(*) from contacts_contacturn where contact_id = $1", Args: []interface{}{models.GeorgeID}, Count: 1, }, // two contacts updated, both cathy and evan since their URNs changed - SQLAssertion{ + { SQL: "select count(*) from contacts_contact where modified_on > $1", Args: []interface{}{now}, Count: 2, diff --git a/hooks/input_labels_added_test.go b/hooks/input_labels_added_test.go index 65617749f..f90abf050 100644 --- a/hooks/input_labels_added_test.go +++ b/hooks/input_labels_added_test.go @@ -39,17 +39,17 @@ func TestInputLabelsAdded(t *testing.T) { models.BobID: msg2, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from msgs_msg_labels WHERE msg_id = $1", Args: []interface{}{msg1.ID()}, Count: 2, }, - SQLAssertion{ + { SQL: "select count(*) from msgs_msg_labels WHERE msg_id = $1", Args: []interface{}{msg2.ID()}, Count: 0, }, - SQLAssertion{ + { SQL: "select count(*) from msgs_msg_labels l JOIN msgs_msg m ON l.msg_id = m.id WHERE m.contact_id = $1", Args: []interface{}{models.BobID}, Count: 0, diff --git a/hooks/msg_created_test.go b/hooks/msg_created_test.go index 52f7830ca..a62de5c53 100644 --- a/hooks/msg_created_test.go +++ b/hooks/msg_created_test.go @@ -65,22 +65,22 @@ func TestMsgCreated(t *testing.T) { models.CathyID: msg1, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "SELECT COUNT(*) FROM msgs_msg WHERE text='Hello World' AND contact_id = $1 AND metadata = $2 AND response_to_id = $3 AND high_priority = TRUE", Args: []interface{}{models.CathyID, `{"quick_replies":["yes","no"]}`, msg1.ID()}, Count: 2, }, - SQLAssertion{ + { SQL: "SELECT COUNT(*) FROM msgs_msg WHERE text='Hello Attachments' AND contact_id = $1 AND attachments[1] = $2 AND status = 'Q' AND high_priority = FALSE", Args: []interface{}{models.GeorgeID, "image/png:https://foo.bar.com/images/image1.png"}, Count: 1, }, - SQLAssertion{ + { SQL: "SELECT COUNT(*) FROM msgs_msg WHERE contact_id=$1;", Args: []interface{}{models.BobID}, Count: 0, }, - SQLAssertion{ + { SQL: "SELECT COUNT(*) FROM msgs_msg WHERE contact_id = $1 AND text = $2 AND metadata = $3 AND direction = 'O' AND status = 'Q' AND channel_id = $4", Args: []interface{}{ models.AlexandriaID, diff --git a/hooks/session_triggered_test.go b/hooks/session_triggered_test.go index 5bff01c64..a11eae324 100644 --- a/hooks/session_triggered_test.go +++ b/hooks/session_triggered_test.go @@ -44,22 +44,22 @@ func TestSessionTriggered(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from flows_flowrun where contact_id = $1 AND is_active = FALSE", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from flows_flowstart where org_id = 1 AND start_type = 'F' AND flow_id = $1 AND status = 'P' AND parent_summary IS NOT NULL;", Args: []interface{}{models.SingleMessageFlowID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from flows_flowstart_contacts where id = 1 AND contact_id = $1", Args: []interface{}{models.GeorgeID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from flows_flowstart_groups where id = 1 AND contactgroup_id = $1", Args: []interface{}{models.TestersGroupID}, Count: 1, diff --git a/hooks/webhook_called_test.go b/hooks/webhook_called_test.go index 5882d54c1..8ea9b5001 100644 --- a/hooks/webhook_called_test.go +++ b/hooks/webhook_called_test.go @@ -49,37 +49,37 @@ func TestWebhookCalled(t *testing.T) { }, }, SQLAssertions: []SQLAssertion{ - SQLAssertion{ + { SQL: "select count(*) from api_resthooksubscriber where is_active = FALSE", Args: nil, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from api_resthooksubscriber where is_active = TRUE and resthook_id = $1", Args: []interface{}{2}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from api_resthooksubscriber where is_active = TRUE", Args: nil, Count: 2, }, - SQLAssertion{ + { SQL: "select count(*) from api_webhookresult where contact_id = $1 AND status_code = 200", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from api_webhookresult where contact_id = $1 AND status_code = 410", Args: []interface{}{models.CathyID}, Count: 1, }, - SQLAssertion{ + { SQL: "select count(*) from api_webhookresult where contact_id = $1", Args: []interface{}{models.GeorgeID}, Count: 3, }, - SQLAssertion{ + { SQL: "select count(*) from api_webhookevent where org_id = $1", Args: []interface{}{models.Org1}, Count: 2, diff --git a/models/groups_test.go b/models/groups_test.go index 6782db613..c18552765 100644 --- a/models/groups_test.go +++ b/models/groups_test.go @@ -52,8 +52,6 @@ func TestDynamicGroups(t *testing.T) { VALUES(TRUE, NOW(), NOW(), $1, 1000, 'W', 'F', -1, $2, 1, 1, $3, $4, 'I') RETURNING id`, uuids.New(), DoctorRemindersCampaignID, FavoritesFlowID, JoinedFieldID) - fmt.Println(eventID) - // clear Cathy's value testsuite.DB().MustExec( `update contacts_contact set fields = fields - $2 diff --git a/search/mock.go b/search/mock.go index c67105cb1..fd824ced5 100644 --- a/search/mock.go +++ b/search/mock.go @@ -1,7 +1,6 @@ package search import ( - "fmt" "io/ioutil" "net/http" "net/http/httptest" @@ -46,9 +45,6 @@ func NewMockElasticServer() *MockElasticServer { body, _ := ioutil.ReadAll(r.Body) mock.LastBody = string(body) - fmt.Println(r.URL) - fmt.Println(mock.LastBody) - w.WriteHeader(200) w.Write([]byte(mock.NextResponse)) mock.NextResponse = "" diff --git a/web/simulation/simulation_test.go b/web/simulation/simulation_test.go index 43e9438bd..36190a4d1 100644 --- a/web/simulation/simulation_test.go +++ b/web/simulation/simulation_test.go @@ -3,7 +3,6 @@ package simulation import ( "bytes" "encoding/json" - "fmt" "io" "io/ioutil" "net/http" @@ -328,7 +327,6 @@ func TestServer(t *testing.T) { json.Unmarshal(content, &parsed) sessionJSON, _ := json.Marshal(parsed["session"]) session = string(sessionJSON) - fmt.Println(session) context, hasContext := parsed["context"] if hasContext {