From a635ee7d0c77e4a796152f7574f1da1a6491237c Mon Sep 17 00:00:00 2001 From: 0xste Date: Fri, 10 Nov 2023 08:27:44 +0000 Subject: [PATCH 1/2] fix: bump dependencies --- .github/workflows/go.yml | 2 +- go.mod | 20 ++++++------ go.sum | 67 +++++++++++----------------------------- 3 files changed, 28 insertions(+), 61 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f869ba3..a4536bb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.21 - name: Build run: go build -v ./... diff --git a/go.mod b/go.mod index ae26d59..e434757 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,23 @@ module github.com/regen-network/gocuke -go 1.17 +go 1.21 require ( - github.com/cockroachdb/apd/v3 v3.1.0 + github.com/cockroachdb/apd/v3 v3.2.1 github.com/cucumber/common/messages/go/v19 v19.1.2 - github.com/cucumber/gherkin/go/v26 v26.0.3 + github.com/cucumber/gherkin/go/v26 v26.2.0 github.com/cucumber/messages/go/v21 v21.0.1 - github.com/cucumber/tag-expressions/go/v5 v5.0.1 - github.com/google/go-cmp v0.5.5 - github.com/stretchr/testify v1.8.1 - gotest.tools/v3 v3.1.0 - pgregory.net/rapid v0.4.7 + github.com/cucumber/tag-expressions/go/v5 v5.0.6 + github.com/google/go-cmp v0.6.0 + github.com/stretchr/testify v1.8.4 + gotest.tools/v3 v3.5.1 + pgregory.net/rapid v1.1.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/gofrs/uuid v4.2.0+incompatible // indirect + github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.4 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a2b7dc8..a8a35ed 100644 --- a/go.sum +++ b/go.sum @@ -1,74 +1,43 @@ -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/messages/go/v19 v19.1.2 h1:8/ZkW9rj3KQo/regmI8kcy48tk57m427Olb7Y0lXcN4= github.com/cucumber/common/messages/go/v19 v19.1.2/go.mod h1:0KLDvMVmmkEZcWUSKxFHSUSLS1gjujBbPN0p41IwwJ4= -github.com/cucumber/gherkin/go/v26 v26.0.3 h1:ExcdadOazxzN11RYQZfaWcODMp7ZbRYLwqMbqWF8QEw= -github.com/cucumber/gherkin/go/v26 v26.0.3/go.mod h1:Xf+SrSuFbivEDZvmHjTShord3zlEkqsj7QB4sxl1SuU= +github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= +github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0= github.com/cucumber/messages/go/v21 v21.0.1 h1:wzA0LxwjlWQYZd32VTlAVDTkW6inOFmSM+RuOwHZiMI= github.com/cucumber/messages/go/v21 v21.0.1/go.mod h1:zheH/2HS9JLVFukdrsPWoPdmUtmYQAQPLk7w5vWsk5s= -github.com/cucumber/tag-expressions/go/v5 v5.0.1 h1:ECMVXw8XECJqSWY6UrpMubsG3LZcQmI4ekCVmhia/E8= -github.com/cucumber/tag-expressions/go/v5 v5.0.1/go.mod h1:O6ISvjl7N4d1lSBGV4XjS9+9RI3ZwiY/i6vDhomjYQQ= +github.com/cucumber/tag-expressions/go/v5 v5.0.6 h1:F0mqsu69cG/3MTTZqy+PlaPcU/MMl936OJjxKgdFgWs= +github.com/cucumber/tag-expressions/go/v5 v5.0.6/go.mod h1:/sHRc0Vt+pPjgQdNZjH8W2cnmb+tiVYp19VESzpGQsw= 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/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 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/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -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/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= -pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= From e03e8526ea4c1cb04b0e982b2cc39a7da6ba8476 Mon Sep 17 00:00:00 2001 From: 0xste Date: Fri, 10 Nov 2023 08:32:15 +0000 Subject: [PATCH 2/2] fix: tests to pass with latest pgregory.net/rapid generics syntax --- hooks_test.go | 2 +- value_test.go | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hooks_test.go b/hooks_test.go index c6c379c..2d776b3 100644 --- a/hooks_test.go +++ b/hooks_test.go @@ -57,7 +57,7 @@ func (s *hooksSuite) IOpenAResource(step Step) { func (s *hooksSuite) IOpenAnyResources(t *rapid.T) { longRun = true - s.numOpenForScenario = rapid.Int64Range(1, 100).Draw(t, "numResources").(int64) + s.numOpenForScenario = rapid.Int64Range(1, 100).AsAny().Draw(t, "numResources").(int64) open += s.numOpenForScenario } diff --git a/value_test.go b/value_test.go index b21f6dc..afb09eb 100644 --- a/value_test.go +++ b/value_test.go @@ -2,12 +2,13 @@ package gocuke import ( "fmt" + "math/big" + "testing" + "github.com/cockroachdb/apd/v3" "github.com/google/go-cmp/cmp" "gotest.tools/v3/assert" - "math/big" "pgregory.net/rapid" - "testing" ) func TestValues(t *testing.T) { @@ -37,7 +38,7 @@ var bigIntComparer = cmp.Comparer(func(x, y *big.Int) bool { }) func (s *valuesSuite) AnyInt64String(t *rapid.T) { - s.AnInt64(rapid.Int64().Draw(t, "orig").(int64)) + s.AnInt64(rapid.Int64().AsAny().Draw(t, "orig").(int64)) } func (s *valuesSuite) WhenIConvertItToAnInt64() { @@ -45,23 +46,23 @@ func (s *valuesSuite) WhenIConvertItToAnInt64() { } var decGen = rapid.Custom(func(t *rapid.T) *apd.Decimal { - nBytes := rapid.IntRange(1, 16).Draw(t, "nBytes").(int) + nBytes := rapid.IntRange(1, 16).AsAny().Draw(t, "nBytes").(int) bytes := make([]byte, nBytes) for i := 0; i < nBytes; i++ { - bytes[i] = rapid.Byte().Draw(t, fmt.Sprintf("byte%d", i)).(byte) + bytes[i] = rapid.Byte().AsAny().Draw(t, fmt.Sprintf("byte%d", i)).(byte) } coeff := &apd.BigInt{} coeff.SetBytes(bytes) - neg := rapid.Bool().Draw(t, "neg").(bool) + neg := rapid.Bool().AsAny().Draw(t, "neg").(bool) if neg { coeff = coeff.Neg(coeff) } - exp := rapid.Int32Range(-5000, 5000).Draw(t, "exp").(int32) + exp := rapid.Int32Range(-5000, 5000).AsAny().Draw(t, "exp").(int32) return apd.NewWithBigInt(coeff, exp) }) func (s *valuesSuite) AnyDecimalString(t *rapid.T) { - s.ADecimal(decGen.Draw(t, "x").(*apd.Decimal)) + s.ADecimal(decGen.AsAny().Draw(t, "x").(*apd.Decimal)) } func (s *valuesSuite) WhenIConvertItToADecimal() { @@ -69,14 +70,14 @@ func (s *valuesSuite) WhenIConvertItToADecimal() { } var bigIntGen = rapid.Custom(func(t *rapid.T) *big.Int { - nBytes := rapid.IntRange(1, 16).Draw(t, "nBytes").(int) + nBytes := rapid.IntRange(1, 16).AsAny().Draw(t, "nBytes").(int) bytes := make([]byte, nBytes) for i := 0; i < nBytes; i++ { - bytes[i] = rapid.Byte().Draw(t, fmt.Sprintf("byte%d", i)).(byte) + bytes[i] = rapid.Byte().AsAny().Draw(t, fmt.Sprintf("byte%d", i)).(byte) } x := &big.Int{} x.SetBytes(bytes) - neg := rapid.Bool().Draw(t, "neg").(bool) + neg := rapid.Bool().AsAny().Draw(t, "neg").(bool) if neg { x = x.Neg(x) } @@ -84,7 +85,7 @@ var bigIntGen = rapid.Custom(func(t *rapid.T) *big.Int { }) func (s *valuesSuite) AnyBigIntegerString(t *rapid.T) { - s.ABigInteger(bigIntGen.Draw(t, "x").(*big.Int)) + s.ABigInteger(bigIntGen.AsAny().Draw(t, "x").(*big.Int)) } func (s *valuesSuite) WhenIConvertItToABigInteger() {