Skip to content

Commit

Permalink
Merge pull request #143 from ownmfa/bconway_test_style_fixes_pkg
Browse files Browse the repository at this point in the history
Test updates and style fixes for Go 1.22 for pkg/
  • Loading branch information
bconway authored Feb 26, 2024
2 parents 342c6a4 + 6d57d50 commit f5ce1cf
Show file tree
Hide file tree
Showing 83 changed files with 699 additions and 2,171 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
## Getting Started

Install [Docker](https://docs.docker.com/get-started/overview/),
[Docker Compose](https://docs.docker.com/compose/) (V1 or V2), and
[Docker Compose](https://docs.docker.com/compose/), and
[Go](https://go.dev/dl/).

```
docker-compose -f build/docker-compose.yml up -d
docker compose -f build/docker-compose.yml up -d
make test
RACE=y make test
docker-compose -f build/docker-compose.yml down
docker compose -f build/docker-compose.yml down
```

## Running an API Locally
Expand All @@ -31,11 +31,11 @@ OpenAPI live docs are available at

## Deploying

[Docker Compose](https://docs.docker.com/compose/) (V1 or V2) files for the
Hermes platform and its dependencies are available in `build/deploy/`. These can
be used for a single-system deploy, or as templates for orchestration tooling
such as [Nomad](https://www.nomadproject.io/) or
[Kubernetes](https://kubernetes.io/). Keys should be provided where applicable.
[Docker Compose](https://docs.docker.com/compose/) files for the Hermes platform
and its dependencies are available in `build/deploy/`. These can be used for a
single-system deploy, or as templates for orchestration tooling such as
[Nomad](https://www.nomadproject.io/) or [Kubernetes](https://kubernetes.io/).
Keys should be provided where applicable.

## Use of Build Tags In Tests

Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ require (
github.com/gregdel/pushover v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
github.com/jackc/pgx/v5 v5.5.3
github.com/jellydator/ttlcache/v3 v3.1.1
github.com/jellydator/ttlcache/v3 v3.2.0
github.com/mennanov/fmutils v0.2.1
github.com/nsqio/go-nsq v1.1.0
github.com/ownmfa/proto/go v1.1.2
github.com/redis/go-redis/v9 v9.4.0
github.com/redis/go-redis/v9 v9.5.1
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/smira/go-statsd v1.3.3
github.com/stretchr/testify v1.8.4
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.19.0
google.golang.org/grpc v1.61.0
golang.org/x/crypto v0.20.0
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.32.0
)

Expand All @@ -38,8 +38,8 @@ require (
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect
google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
28 changes: 14 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s=
github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jellydator/ttlcache/v3 v3.1.1 h1:RCgYJqo3jgvhl+fEWvjNW8thxGWsgxi+TPhRir1Y9y8=
github.com/jellydator/ttlcache/v3 v3.1.1/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4=
github.com/jellydator/ttlcache/v3 v3.2.0 h1:6lqVJ8X3ZaUwvzENqPAobDsXNExfUJd61u++uW8a3LE=
github.com/jellydator/ttlcache/v3 v3.2.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
Expand All @@ -557,8 +557,8 @@ github.com/ownmfa/proto/go v1.1.2/go.mod h1:9+2QP5peqzs3yE5NWUviHtfZV3WGTREI4tzi
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk=
github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down Expand Up @@ -606,8 +606,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1045,12 +1045,12 @@ google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZV
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg=
google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 h1:g/4bk7P6TPMkAUbUhquq98xey1slwvuVJPosdBqYJlU=
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014/go.mod h1:xEgQu1e4stdSSsxPDK8Azkrk/ECl5HvdPf6nbZrTS5M=
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A=
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4=
google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ=
google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo=
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o=
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down Expand Up @@ -1087,8 +1087,8 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk=
google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
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=
Expand Down
10 changes: 4 additions & 6 deletions pkg/cache/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ func TestNewRedis(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can connect %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can connect %+v", test), func(t *testing.T) {
t.Parallel()

res, err := NewRedis(lTest.inp)
res, err := NewRedis(test.inp)
t.Logf("res, err: %+v, %v", res, err)
if lTest.err == "" {
if test.err == "" {
require.NotNil(t, res)
require.NoError(t, err)
} else {
require.Contains(t, err.Error(), lTest.err)
require.Contains(t, err.Error(), test.err)
}
})
}
Expand Down
48 changes: 18 additions & 30 deletions pkg/config/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ func TestString(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := String(lTest.inpKey, lTest.inpDef)
res := String(test.inpKey, test.inpDef)
t.Logf("res: %v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
Expand Down Expand Up @@ -70,14 +68,12 @@ func TestStringSlice(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := StringSlice(lTest.inpKey, lTest.inpDef)
res := StringSlice(test.inpKey, test.inpDef)
t.Logf("res: %#v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
Expand All @@ -101,14 +97,12 @@ func TestInt(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := Int(lTest.inpKey, lTest.inpDef)
res := Int(test.inpKey, test.inpDef)
t.Logf("res: %v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
Expand All @@ -131,14 +125,12 @@ func TestBool(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := Bool(lTest.inpKey, lTest.inpDef)
res := Bool(test.inpKey, test.inpDef)
t.Logf("res: %v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
Expand All @@ -162,14 +154,12 @@ func TestDuration(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := Duration(lTest.inpKey, lTest.inpDef)
res := Duration(test.inpKey, test.inpDef)
t.Logf("res: %#v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
Expand Down Expand Up @@ -197,14 +187,12 @@ func TestByteSlice(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can parse %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can parse %+v", test), func(t *testing.T) {
t.Parallel()

res := ByteSlice(lTest.inp)
res := ByteSlice(test.inp)
t.Logf("res: %x", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
6 changes: 2 additions & 4 deletions pkg/consterr/consterr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ import (
func TestOrg(t *testing.T) {
t.Parallel()

for i := 0; i < 5; i++ {
lTest := i

t.Run(fmt.Sprintf("Can error %v", lTest), func(t *testing.T) {
for i := range 5 {
t.Run(fmt.Sprintf("Can error %v", i), func(t *testing.T) {
t.Parallel()

errStr := random.String(10)
Expand Down
26 changes: 11 additions & 15 deletions pkg/crypto/encrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ func TestEncrypt(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can encrypt %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can encrypt %+v", test), func(t *testing.T) {
t.Parallel()

res, err := Encrypt(lTest.inpKey, lTest.inpPlaintext)
res, err := Encrypt(test.inpKey, test.inpPlaintext)
t.Logf("res, err: %x, %v", res, err)
require.Len(t, res, lTest.resLen)
require.Equal(t, lTest.err, err)
require.Len(t, res, test.resLen)
require.Equal(t, test.err, err)
})
}
}
Expand Down Expand Up @@ -70,24 +68,22 @@ func TestDecrypt(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can encrypt %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can encrypt %+v", test), func(t *testing.T) {
t.Parallel()

resEnc, err := Encrypt(lTest.inpEncKey, lTest.inpPlaintext)
resEnc, err := Encrypt(test.inpEncKey, test.inpPlaintext)
t.Logf("resEnc, err: %x, %v", resEnc, err)
require.NoError(t, err)

var resDec []byte
if lTest.inpCiphertext == nil {
resDec, err = Decrypt(lTest.inpDecKey, resEnc)
if test.inpCiphertext == nil {
resDec, err = Decrypt(test.inpDecKey, resEnc)
} else {
resDec, err = Decrypt(lTest.inpDecKey, lTest.inpCiphertext)
resDec, err = Decrypt(test.inpDecKey, test.inpCiphertext)
}
t.Logf("resDec, err: %x, %#v", resDec, err)
require.Equal(t, lTest.inpPlaintext, resDec)
require.Equal(t, lTest.err, err)
require.Equal(t, test.inpPlaintext, resDec)
require.Equal(t, test.err, err)
})
}
}
8 changes: 3 additions & 5 deletions pkg/crypto/password_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ func TestCheckPass(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can check %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can check %+v", test), func(t *testing.T) {
t.Parallel()

err := CheckPass(lTest.inp)
err := CheckPass(test.inp)
t.Logf("err: %v", err)
require.Equal(t, lTest.err, err)
require.Equal(t, test.err, err)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dao/app/crudl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func TestList(t *testing.T) {
appEmails := []string{}
appPushoverKeys := []string{}
appTSes := []time.Time{}
for i := 0; i < 3; i++ {
for range 3 {
createApp, err := globalAppDAO.Create(ctx, random.App("dao-app",
createOrg.GetId()))
t.Logf("createApp, err: %+v, %v", createApp, err)
Expand Down
8 changes: 3 additions & 5 deletions pkg/dao/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ func TestDBToSentinel(t *testing.T) {
}

for _, test := range tests {
lTest := test

t.Run(fmt.Sprintf("Can map %+v", lTest), func(t *testing.T) {
t.Run(fmt.Sprintf("Can map %+v", test), func(t *testing.T) {
t.Parallel()

res := DBToSentinel(lTest.inp)
res := DBToSentinel(test.inp)
t.Logf("res: %#v", res)
require.Equal(t, lTest.res, res)
require.Equal(t, test.res, res)
})
}
}
4 changes: 2 additions & 2 deletions pkg/dao/event/crudl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestList(t *testing.T) {

events := []*api.Event{}

for i := 0; i < 5; i++ {
for range 5 {
event := random.Event("dao-event", createOrg.GetId())
event.IdentityId = identityID
events = append(events, event)
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestLatest(t *testing.T) {

events := []*api.Event{}

for i := 0; i < 5; i++ {
for range 5 {
event := random.Event("dao-event", createOrg.GetId())
events = append(events, event)

Expand Down
2 changes: 1 addition & 1 deletion pkg/dao/identity/crudl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func TestList(t *testing.T) {
identityIDs := []string{}
identityComments := []string{}
identityTSes := []time.Time{}
for i := 0; i < 3; i++ {
for range 3 {
createIdentity, _, _, err := globalIdentDAO.Create(ctx,
random.HOTPIdentity("dao-identity", createOrg.GetId(), createApp.GetId()))
t.Logf("createIdentity, err: %+v, %v", createIdentity, err)
Expand Down
Loading

0 comments on commit f5ce1cf

Please sign in to comment.