Skip to content

Commit 3c69196

Browse files
committed
run TestConfig without -race
1 parent acc4642 commit 3c69196

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

.github/workflows/seth-test.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,61 @@ jobs:
1212
- regex: TestSmoke
1313
network-type: Geth
1414
url: "ws://localhost:8546"
15+
extra_flags: "-race"
1516
- regex: TestSmoke
1617
network-type: Anvil
1718
url: "http://localhost:8545"
19+
extra_flags: "-race"
1820
- regex: TestAPI
1921
network-type: Geth
2022
url: "ws://localhost:8546"
23+
extra_flags: "-race"
2124
- regex: TestAPI
2225
network-type: Anvil
2326
url: "http://localhost:8545"
27+
extra_flags: "-race"
2428
- regex: TestTrace
2529
network-type: Geth
2630
url: "ws://localhost:8546"
31+
extra_flags: "-race"
2732
- regex: TestTrace
2833
network-type: Anvil
2934
url: "http://localhost:8545"
35+
extra_flags: "-race"
3036
- regex: TestCLI
3137
network-type: Geth
3238
url: "ws://localhost:8546"
39+
extra_flags: "-race"
3340
- regex: TestCLI
3441
network-type: Anvil
3542
url: "http://localhost:8545"
43+
extra_flags: "-race"
3644
# TODO: wasn't stable before, fix if possible
3745
# - regex: TestGasBumping
3846
# network-type: Geth
3947
# url: "ws://localhost:8546"
4048
# - regex: TestGasBumping
4149
# network-type: Anvil
4250
# url: "http://localhost:8545"
43-
- regex: "'TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract|TestConfig'"
51+
# Some test config tests use Simualted Backend, which is not has data races...
52+
- regex: "'TestConfig'"
4453
network-type: Geth
4554
url: "ws://localhost:8546"
55+
extra_flags: "''"
4656
# TODO: still expects Geth WS URL for some reason
47-
# - regex: "'TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract|TestConfig'"
48-
# network-type: Anvil
49-
# url: "http://localhost:8545"
57+
- regex: "'TestConfig'"
58+
network-type: Anvil
59+
url: "http://localhost:8545"
60+
extra_flags: "''"
61+
- regex: "'TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract'"
62+
network-type: Geth
63+
url: "ws://localhost:8546"
64+
extra_flags: "-race"
65+
# TODO: still expects Geth WS URL for some reason
66+
- regex: "'TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract'"
67+
network-type: Anvil
68+
url: "http://localhost:8545"
69+
extra_flags: "-race"
5070
defaults:
5171
run:
5272
working-directory: seth
@@ -86,4 +106,4 @@ jobs:
86106
just-version: '1.39.0'
87107
- name: Run tests
88108
run: |
89-
devbox run -- just seth-test ${{ matrix.test.network-type }} ${{ matrix.test.url }} ${{ matrix.test.regex }}
109+
devbox run -- just seth-test ${{ matrix.test.network-type }} ${{ matrix.test.url }} ${{ matrix.test.regex }} ${{ matrix.test.extra_flags}}

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ seth-Geth:
120120
geth --graphql --http --http.api admin,debug,web3,eth,txpool,personal,miner,net --http.corsdomain "*" --ws --ws.api admin,debug,web3,eth,txpool,personal,miner,net --ws.origins "*" --mine --miner.etherbase 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --unlock f39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --allow-insecure-unlock --datadir ./geth_data --password geth_data/password.txt --nodiscover --vmdebug --networkid 1337 > /dev/null 2>&1 &
121121

122122
# Seth: run Seth tests, example: just seth-test Anvil http://localhost:8545 "TestAPI"
123-
seth-test network url test_regex:
123+
seth-test network url test_regex extra_flags:
124124
@just seth-{{network}}
125-
cd seth && SETH_URL={{url}} SETH_NETWORK={{network}} SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -race `go list ./... | grep -v examples` -run "{{test_regex}}" || pkill -f {{network}}
125+
cd seth && SETH_URL={{url}} SETH_NETWORK={{network}} SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v "{{extra_flags}}" `go list ./... | grep -v examples` -run "{{test_regex}}" || pkill -f {{network}}
126126

127127
# Run pre-commit hooks, build, lint, tidy, check typos
128128
pre-commit:

seth/client_builder_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"crypto/ecdsa"
55
"math/big"
66
"os"
7+
"strings"
78
"testing"
89
"time"
910

@@ -47,8 +48,9 @@ func getRpc() (string, error) {
4748
if os.Getenv("SETH_NETWORK") == "" {
4849
return "", errors.New("SETH_NETWORK is not set")
4950
}
51+
5052
url := "ws://localhost:8546"
51-
if os.Getenv("SETH_NETWORK") == "anvil" {
53+
if strings.EqualFold(os.Getenv("SETH_NETWORK"), "anvil") {
5254
url = "ws://localhost:8545"
5355
}
5456

0 commit comments

Comments
 (0)