Skip to content

Commit 80ff00c

Browse files
NathanBSCbuddh0
authored andcommitted
tests: run spec-tests in evm-test CI
1 parent 39e0dc6 commit 80ff00c

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.github/workflows/evm-tests.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ jobs:
4949
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
5050
ANDROID_HOME: "" # Skip android test
5151
run: |
52-
git submodule update --init --depth 1 --recursive
5352
go mod download
54-
cd tests
55-
sed -i -e 's/\/\/ bt.skipLoad/bt.skipLoad/g' block_test.go
56-
bash -x run-evm-tests.sh
53+
cd tests && bash -x run-evm-tests.sh
54+

build/ci.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ func doTest(cmdline []string) {
294294
timeout = flag.String("timeout", "10m", `Timeout of runing tests`)
295295
race = flag.Bool("race", false, "Execute the race detector")
296296
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
297-
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
297+
// cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
298298
)
299299
flag.CommandLine.Parse(cmdline)
300300

301301
// Get test fixtures.
302302
csdb := build.MustLoadChecksums("build/checksums.txt")
303-
downloadSpecTestFixtures(csdb, *cachedir)
303+
// downloadSpecTestFixtures(csdb, *cachedir)
304304

305305
// Configure the toolchain.
306306
tc := build.GoToolchain{GOARCH: *arch, CC: *cc}
@@ -346,6 +346,8 @@ func doTest(cmdline []string) {
346346
}
347347

348348
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
349+
//
350+
//nolint:unused
349351
func downloadSpecTestFixtures(csdb *build.ChecksumDB, cachedir string) string {
350352
executionSpecTestsVersion, err := build.Version(csdb, "spec-tests")
351353
if err != nil {

tests/block_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func TestExecutionSpecBlocktests(t *testing.T) {
6363
t.Skipf("directory %s does not exist", executionSpecBlockchainTestDir)
6464
}
6565
bt := new(testMatcher)
66+
67+
// the deployment is different from go-ethereum
68+
bt.skipLoad("^prague/eip2935_historical_block_hashes_from_state/contract_deployment/system_contract_deployment.json")
69+
6670
bt.walk(t, executionSpecBlockchainTestDir, func(t *testing.T, name string, test *BlockTest) {
6771
execBlockTest(t, bt, test)
6872
})

tests/run-evm-tests.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/usr/bin/env bash
2-
32
cd ..
3+
git submodule update --init --depth 1 --recursive
44
git apply tests/0001-diff-go-ethereum.patch
55
cd tests
6+
rm -rf spec-tests && mkdir spec-tests && cd spec-tests
7+
wget https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-6%40v1.0.0/fixtures_pectra-devnet-6.tar.gz
8+
tar xzf fixtures_pectra-devnet-6.tar.gz && rm -f fixtures_pectra-devnet-6.tar.gz
9+
cd ..
610
go test -run . -v >test.log
711
PASS=`cat test.log |grep "PASS:" |wc -l`
812
cat test.log|grep FAIL > fail.log

0 commit comments

Comments
 (0)