From 43b8562e2d59db69b2c0495288e75b8ad551b538 Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Thu, 21 Nov 2024 21:25:42 +0530 Subject: [PATCH 1/4] Use flag instead of env var for system_test --- .github/workflows/ci.yml | 14 ++++--------- .github/workflows/gotestsum.sh | 11 +++++++++++ Makefile | 2 +- arbos/programs/cgo_test.go | 20 +++++++++++-------- das/aggregator_test.go | 21 ++++++++++++-------- system_tests/common_test.go | 9 +++++---- system_tests/das_test.go | 25 +----------------------- system_tests/full_challenge_impl_test.go | 7 ------- util/redisutil/test_redis.go | 14 ++++++++----- util/testhelpers/env/env.go | 11 +++++++---- 10 files changed, 63 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ed49634ad..c2f22b5ed5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,33 +142,27 @@ jobs: - name: run tests without race detection and path state scheme if: matrix.test-mode == 'defaults' - env: - TEST_STATE_SCHEME: path run: | echo "Running tests with Path Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --cover + ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --cover --flags -TEST_STATE_SCHEME=hash - name: run tests without race detection and hash state scheme if: matrix.test-mode == 'defaults' - env: - TEST_STATE_SCHEME: hash run: | echo "Running tests with Hash Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m + ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --flags -TEST_STATE_SCHEME=hash - name: run tests with race detection and hash state scheme if: matrix.test-mode == 'race' - env: - TEST_STATE_SCHEME: hash run: | echo "Running tests with Hash Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --race --timeout 30m + ${{ github.workspace }}/.github/workflows/gotestsum.sh --race --timeout 30m --flags -TEST_STATE_SCHEME=hash - name: run redis tests if: matrix.test-mode == 'defaults' run: | echo "Running redis tests" >> full.log - TEST_REDIS=redis://localhost:6379/0 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... + gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... -TEST_REDIS=redis://localhost:6379/0 - name: create block input json file if: matrix.test-mode == 'defaults' diff --git a/.github/workflows/gotestsum.sh b/.github/workflows/gotestsum.sh index ed631847b7..c5387e9f5c 100755 --- a/.github/workflows/gotestsum.sh +++ b/.github/workflows/gotestsum.sh @@ -10,6 +10,7 @@ check_missing_value() { timeout="" tags="" run="" +flags="" race=false cover=false while [[ $# -gt 0 ]]; do @@ -32,6 +33,12 @@ while [[ $# -gt 0 ]]; do run=$1 shift ;; + --flags) + shift + check_missing_value $# "$1" "--flags" + flags=$1 + shift + ;; --race) race=true shift @@ -63,6 +70,10 @@ for package in $packages; do cmd="$cmd -run=$run" fi + if [ "$flags" != "" ]; then + cmd="$cmd $flags" + fi + if [ "$race" == true ]; then cmd="$cmd -race" fi diff --git a/Makefile b/Makefile index 12dfb07cf8..8bca5807e4 100644 --- a/Makefile +++ b/Makefile @@ -240,7 +240,7 @@ test-go-stylus: test-go-deps .PHONY: test-go-redis test-go-redis: test-go-deps - TEST_REDIS=redis://localhost:6379/0 gotestsum --format short-verbose --no-color=false -- -p 1 -run TestRedis ./system_tests/... ./arbnode/... + gotestsum --format short-verbose --no-color=false -- -p 1 -run TestRedis ./system_tests/... ./arbnode/... -TEST_REDIS=redis://localhost:6379/0 @printf $(done) .PHONY: test-gen-proofs diff --git a/arbos/programs/cgo_test.go b/arbos/programs/cgo_test.go index e16c362ef8..fb1c1c8c93 100644 --- a/arbos/programs/cgo_test.go +++ b/arbos/programs/cgo_test.go @@ -7,12 +7,16 @@ package programs import ( + "flag" "fmt" - "os" "strings" "testing" ) +var ( + compileFlag = flag.String("TEST_COMPILE", "", "[STORE|LOAD] to allow store/load in compile test") +) + func TestConstants(t *testing.T) { err := testConstants() if err != nil { @@ -22,20 +26,20 @@ func TestConstants(t *testing.T) { // normal test will not write anything to disk // to test cross-compilation: -// * run test with TEST_COMPILE=STORE on one machine +// * run test with -TEST_COMPILE=STORE on one machine // * copy target/testdata to the other machine -// * run test with TEST_COMPILE=LOAD on the other machine +// * run test with -TEST_COMPILE=LOAD on the other machine func TestCompileArch(t *testing.T) { - compile_env := os.Getenv("TEST_COMPILE") - if compile_env == "" { - fmt.Print("use TEST_COMPILE=[STORE|LOAD] to allow store/load in compile test") + flag.Parse() + if *compileFlag == "" { + fmt.Print("use -TEST_COMPILE=[STORE|LOAD] to allow store/load in compile test") } - store := strings.Contains(compile_env, "STORE") + store := strings.Contains(*compileFlag, "STORE") err := testCompileArch(store) if err != nil { t.Fatal(err) } - if store || strings.Contains(compile_env, "LOAD") { + if store || strings.Contains(*compileFlag, "LOAD") { err = testCompileLoad() if err != nil { t.Fatal(err) diff --git a/das/aggregator_test.go b/das/aggregator_test.go index 217315eef0..1afb70e5f8 100644 --- a/das/aggregator_test.go +++ b/das/aggregator_test.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "errors" + "flag" "fmt" "io" "math/rand" @@ -22,6 +23,12 @@ import ( "github.com/offchainlabs/nitro/blsSignatures" ) +var ( + seedFlag = flag.String("SEED", "", "Seed for random number generator") + runsFlag = flag.String("RUNS", "", "Number of runs for test") + loggingFlag = flag.String("LOGGING", "", "Enable logging") +) + func TestDAS_BasicAggregationLocal(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -243,25 +250,23 @@ func testConfigurableStorageFailures(t *testing.T, shouldFailAggregation bool) { func initTest(t *testing.T) int { t.Parallel() seed := time.Now().UnixNano() - seedStr := os.Getenv("SEED") - if len(seedStr) > 0 { + flag.Parse() + if len(*seedFlag) > 0 { var err error - intSeed, err := strconv.Atoi(seedStr) + intSeed, err := strconv.Atoi(*seedFlag) Require(t, err, "Failed to parse string") seed = int64(intSeed) } rand.Seed(seed) - runsStr := os.Getenv("RUNS") runs := 2 ^ 32 - if len(runsStr) > 0 { + if len(*runsFlag) > 0 { var err error - runs, err = strconv.Atoi(runsStr) + runs, err = strconv.Atoi(*runsFlag) Require(t, err, "Failed to parse string") } - loggingStr := os.Getenv("LOGGING") - if len(loggingStr) > 0 { + if len(*loggingFlag) > 0 { enableLogging() } diff --git a/system_tests/common_test.go b/system_tests/common_test.go index 277c97858a..b6ae9b0ecb 100644 --- a/system_tests/common_test.go +++ b/system_tests/common_test.go @@ -1681,11 +1681,11 @@ func doUntil(t *testing.T, delay time.Duration, max int, lambda func() bool) { } func TestMain(m *testing.M) { - logLevelEnv := os.Getenv("TEST_LOGLEVEL") - if logLevelEnv != "" { - logLevel, err := strconv.ParseInt(logLevelEnv, 10, 32) + flag.Parse() + if *logLevelFlag != "" { + logLevel, err := strconv.ParseInt(*logLevelFlag, 10, 32) if err != nil || logLevel > int64(log.LevelCrit) { - log.Warn("TEST_LOGLEVEL exists but out of bound, ignoring", "logLevel", logLevelEnv, "max", log.LvlTrace) + log.Warn("-TEST_LOGLEVEL exists but out of bound, ignoring", "logLevel", *logLevelFlag, "max", log.LvlTrace) } glogger := log.NewGlogHandler( log.NewTerminalHandler(io.Writer(os.Stderr), false)) @@ -1721,6 +1721,7 @@ var ( recordBlockInputsWithBaseDir = flag.String("recordBlockInputs.WithBaseDir", "", "Base directory for validationInputsWriter") recordBlockInputsWithTimestampDirEnabled = flag.Bool("recordBlockInputs.WithTimestampDirEnabled", true, "Whether to add timestamp directory while recording block inputs") recordBlockInputsWithBlockIdInFileNameEnabled = flag.Bool("recordBlockInputs.WithBlockIdInFileNameEnabled", true, "Whether to record block inputs using test specific block_id") + logLevelFlag = flag.String("TEST_LOGLEVEL", "", "Log level for tests") ) // recordBlock writes a json file with all of the data needed to validate a block. diff --git a/system_tests/das_test.go b/system_tests/das_test.go index 52703c879d..db0ea12827 100644 --- a/system_tests/das_test.go +++ b/system_tests/das_test.go @@ -7,20 +7,15 @@ import ( "context" "encoding/base64" "errors" - "io" - "log/slog" "math/big" "net" "net/http" - "os" - "strconv" "testing" "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/blsSignatures" @@ -195,7 +190,7 @@ func checkBatchPosting(t *testing.T, ctx context.Context, l1client, l2clientA *e } func TestDASComplexConfigAndRestMirror(t *testing.T) { - initTest(t) + t.Parallel() ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -305,24 +300,6 @@ func TestDASComplexConfigAndRestMirror(t *testing.T) { Require(t, err) } -func enableLogging(logLvl int) { - glogger := log.NewGlogHandler( - log.NewTerminalHandler(io.Writer(os.Stderr), false)) - glogger.Verbosity(slog.Level(logLvl)) - log.SetDefault(log.NewLogger(glogger)) -} - -func initTest(t *testing.T) { - t.Parallel() - loggingStr := os.Getenv("LOGGING") - if len(loggingStr) > 0 { - var err error - logLvl, err := strconv.Atoi(loggingStr) - Require(t, err, "Failed to parse string") - enableLogging(logLvl) - } -} - func TestDASBatchPosterFallback(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/system_tests/full_challenge_impl_test.go b/system_tests/full_challenge_impl_test.go index bf30c928d8..b024308fbf 100644 --- a/system_tests/full_challenge_impl_test.go +++ b/system_tests/full_challenge_impl_test.go @@ -8,7 +8,6 @@ import ( "context" "io" "math/big" - "os" "strings" "testing" "time" @@ -18,7 +17,6 @@ import ( "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" @@ -234,11 +232,6 @@ func setupSequencerInboxStub(ctx context.Context, t *testing.T, l1Info *Blockcha } func RunChallengeTest(t *testing.T, asserterIsCorrect bool, useStubs bool, challengeMsgIdx int64, wasmRootDir string) { - glogger := log.NewGlogHandler( - log.NewTerminalHandler(io.Writer(os.Stderr), false)) - glogger.Verbosity(log.LvlInfo) - log.SetDefault(log.NewLogger(glogger)) - ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/util/redisutil/test_redis.go b/util/redisutil/test_redis.go index 9cabfc23d6..acc5cc99b3 100644 --- a/util/redisutil/test_redis.go +++ b/util/redisutil/test_redis.go @@ -5,8 +5,8 @@ package redisutil import ( "context" + "flag" "fmt" - "os" "testing" "github.com/alicebob/miniredis/v2" @@ -14,12 +14,16 @@ import ( "github.com/offchainlabs/nitro/util/testhelpers" ) -// CreateTestRedis Provides external redis url, this is only done in TEST_REDIS env, +var ( + redisFlag = flag.String("TEST_REDIS", "", "Redis URL for testing") +) + +// CreateTestRedis Provides external redis url, this is only done with -TEST_REDIS flag, // else creates a new miniredis and returns its url. func CreateTestRedis(ctx context.Context, t *testing.T) string { - redisUrl := os.Getenv("TEST_REDIS") - if redisUrl != "" { - return redisUrl + flag.Parse() + if *redisFlag != "" { + return *redisFlag } redisServer, err := miniredis.Run() testhelpers.RequireImpl(t, err) diff --git a/util/testhelpers/env/env.go b/util/testhelpers/env/env.go index 2a8090c212..8cc9040686 100644 --- a/util/testhelpers/env/env.go +++ b/util/testhelpers/env/env.go @@ -4,19 +4,22 @@ package env import ( - "os" + "flag" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/log" ) +var ( + stateSchemeFlag = flag.String("TEST_STATE_SCHEME", "", "State scheme to use for tests") +) + // There are two CI steps, one to run tests using the path state scheme, and one to run tests using the hash state scheme. // An environment variable controls that behavior. func GetTestStateScheme() string { - envTestStateScheme := os.Getenv("TEST_STATE_SCHEME") stateScheme := rawdb.HashScheme - if envTestStateScheme == rawdb.PathScheme || envTestStateScheme == rawdb.HashScheme { - stateScheme = envTestStateScheme + if *stateSchemeFlag == rawdb.PathScheme || *stateSchemeFlag == rawdb.HashScheme { + stateScheme = *stateSchemeFlag } log.Debug("test state scheme", "testStateScheme", stateScheme) return stateScheme From 5115c4e351bd9c92190afe9a60f86a82199078b1 Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Thu, 12 Dec 2024 20:09:15 +0530 Subject: [PATCH 2/4] fix gotestsum.sh --- .github/workflows/gotestsum.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gotestsum.sh b/.github/workflows/gotestsum.sh index c5387e9f5c..da770d261a 100755 --- a/.github/workflows/gotestsum.sh +++ b/.github/workflows/gotestsum.sh @@ -1,7 +1,7 @@ #!/bin/bash check_missing_value() { - if [[ $1 -eq 0 || $2 == -* ]]; then + if [[ $1 -eq 0 || ($2 == -* && $3 != "--flags") ]]; then echo "missing $3 argument value" exit 1 fi From 3ad410431774a92c34eb4474e96578567a32be9d Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Mon, 16 Dec 2024 20:40:20 +0530 Subject: [PATCH 3/4] fix --- .github/workflows/ci.yml | 6 +++--- .github/workflows/gotestsum.sh | 20 ++++++++++---------- go.mod | 12 ++++++------ go.sum | 18 ++++++++---------- util/testhelpers/env/env.go | 1 + 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0078b85fd..60eecf629e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,19 +144,19 @@ jobs: if: matrix.test-mode == 'defaults' run: | echo "Running tests with Path Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --cover --flags -TEST_STATE_SCHEME=hash + ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --cover --test_state_scheme hash - name: run tests without race detection and hash state scheme if: matrix.test-mode == 'defaults' run: | echo "Running tests with Hash Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --flags -TEST_STATE_SCHEME=hash + ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 20m --test_state_scheme hash - name: run tests with race detection and hash state scheme if: matrix.test-mode == 'race' run: | echo "Running tests with Hash Scheme" >> full.log - ${{ github.workspace }}/.github/workflows/gotestsum.sh --race --timeout 30m --flags -TEST_STATE_SCHEME=hash + ${{ github.workspace }}/.github/workflows/gotestsum.sh --race --timeout 30m --test_state_scheme hash - name: run redis tests if: matrix.test-mode == 'defaults' diff --git a/.github/workflows/gotestsum.sh b/.github/workflows/gotestsum.sh index da770d261a..d4430567ca 100755 --- a/.github/workflows/gotestsum.sh +++ b/.github/workflows/gotestsum.sh @@ -1,7 +1,7 @@ #!/bin/bash check_missing_value() { - if [[ $1 -eq 0 || ($2 == -* && $3 != "--flags") ]]; then + if [[ $1 -eq 0 || $2 == -* ]]; then echo "missing $3 argument value" exit 1 fi @@ -10,7 +10,7 @@ check_missing_value() { timeout="" tags="" run="" -flags="" +test_state_scheme="" race=false cover=false while [[ $# -gt 0 ]]; do @@ -33,10 +33,10 @@ while [[ $# -gt 0 ]]; do run=$1 shift ;; - --flags) + --test_state_scheme) shift - check_missing_value $# "$1" "--flags" - flags=$1 + check_missing_value $# "$1" "--test_state_scheme" + test_state_scheme=$1 shift ;; --race) @@ -56,7 +56,7 @@ done packages=$(go list ./...) for package in $packages; do - cmd="stdbuf -oL gotestsum --format short-verbose --packages=\"$package\" --rerun-fails=2 --no-color=false --" + cmd="stdbuf -oL gotestsum --format short-verbose --no-color=false -- \"$package\"" if [ "$timeout" != "" ]; then cmd="$cmd -timeout $timeout" @@ -70,10 +70,6 @@ for package in $packages; do cmd="$cmd -run=$run" fi - if [ "$flags" != "" ]; then - cmd="$cmd $flags" - fi - if [ "$race" == true ]; then cmd="$cmd -race" fi @@ -82,6 +78,10 @@ for package in $packages; do cmd="$cmd -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/..." fi + if [ "$test_state_scheme" != "" ]; then + cmd="$cmd -- -TEST_STATE_SCHEME=$test_state_scheme" + fi + cmd="$cmd > >(stdbuf -oL tee -a full.log | grep -vE \"INFO|seal\")" echo "" diff --git a/go.mod b/go.mod index 7a48b0520d..614a2921ce 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.64.1 github.com/cavaliergopher/grab/v3 v3.0.1 + github.com/ccoveille/go-safecast v1.1.0 github.com/cockroachdb/pebble v1.1.0 github.com/codeclysm/extract/v3 v3.0.2 github.com/dgraph-io/badger/v4 v4.2.0 @@ -51,7 +52,7 @@ require ( golang.org/x/term v0.21.0 golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/api v0.187.0 - gopkg.in/natefinch/lumberjack.v2 v2.0.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) require ( @@ -60,7 +61,6 @@ require ( cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect - github.com/ccoveille/go-safecast v1.1.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -85,8 +85,8 @@ require ( require ( github.com/DataDog/zstd v1.5.2 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/VictoriaMetrics/fastcache v1.12.1 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/VictoriaMetrics/fastcache v1.12.2 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect @@ -113,10 +113,10 @@ require ( github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect diff --git a/go.sum b/go.sum index 55ad86267a..7341159a6b 100644 --- a/go.sum +++ b/go.sum @@ -14,14 +14,12 @@ cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodE cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= @@ -136,16 +134,16 @@ github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= -github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -698,8 +696,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4 h1:hILp2hNrRnYjZpmIbx70psAHbBSEcQ1NIzDcUbJ1b6g= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/util/testhelpers/env/env.go b/util/testhelpers/env/env.go index 8cc9040686..67a83b0e3e 100644 --- a/util/testhelpers/env/env.go +++ b/util/testhelpers/env/env.go @@ -17,6 +17,7 @@ var ( // There are two CI steps, one to run tests using the path state scheme, and one to run tests using the hash state scheme. // An environment variable controls that behavior. func GetTestStateScheme() string { + flag.Parse() stateScheme := rawdb.HashScheme if *stateSchemeFlag == rawdb.PathScheme || *stateSchemeFlag == rawdb.HashScheme { stateScheme = *stateSchemeFlag From d67663f3d585c54d442cdfec760b8c557f203a43 Mon Sep 17 00:00:00 2001 From: Aman Sanghi Date: Mon, 16 Dec 2024 21:48:55 +0530 Subject: [PATCH 4/4] fix go.mod --- go.mod | 14 +++++++------- go.sum | 20 +++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 614a2921ce..b306f014bf 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,6 @@ require ( github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.27 github.com/aws/aws-sdk-go-v2/service/s3 v1.64.1 github.com/cavaliergopher/grab/v3 v3.0.1 - github.com/ccoveille/go-safecast v1.1.0 github.com/cockroachdb/pebble v1.1.0 github.com/codeclysm/extract/v3 v3.0.2 github.com/dgraph-io/badger/v4 v4.2.0 @@ -52,7 +51,7 @@ require ( golang.org/x/term v0.21.0 golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/api v0.187.0 - gopkg.in/natefinch/lumberjack.v2 v2.2.1 + gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) require ( @@ -61,6 +60,7 @@ require ( cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.8 // indirect + github.com/ccoveille/go-safecast v1.1.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -85,8 +85,8 @@ require ( require ( github.com/DataDog/zstd v1.5.2 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/VictoriaMetrics/fastcache v1.12.2 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect @@ -113,10 +113,10 @@ require ( github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect + github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -200,4 +200,4 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.34.2 // indirect rsc.io/tmplfunc v0.0.3 // indirect -) +) \ No newline at end of file diff --git a/go.sum b/go.sum index 7341159a6b..52bda469f2 100644 --- a/go.sum +++ b/go.sum @@ -14,12 +14,14 @@ cloud.google.com/go/longrunning v0.5.7/go.mod h1:8GClkudohy1Fxm3owmBGid8W0pSgodE cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= -github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= @@ -134,16 +136,16 @@ github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= -github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -696,8 +698,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4 h1:hILp2hNrRnYjZpmIbx70psAHbBSEcQ1NIzDcUbJ1b6g= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -714,4 +716,4 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= \ No newline at end of file