Skip to content

Commit

Permalink
tests: run spec-tests in evm-test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC authored and buddh0 committed Feb 7, 2025
1 parent 39e0dc6 commit 80ff00c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/evm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
ANDROID_HOME: "" # Skip android test
run: |
git submodule update --init --depth 1 --recursive
go mod download
cd tests
sed -i -e 's/\/\/ bt.skipLoad/bt.skipLoad/g' block_test.go
bash -x run-evm-tests.sh
cd tests && bash -x run-evm-tests.sh
6 changes: 4 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ func doTest(cmdline []string) {
timeout = flag.String("timeout", "10m", `Timeout of runing tests`)
race = flag.Bool("race", false, "Execute the race detector")
short = flag.Bool("short", false, "Pass the 'short'-flag to go test")
cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
// cachedir = flag.String("cachedir", "./build/cache", "directory for caching downloads")
)
flag.CommandLine.Parse(cmdline)

// Get test fixtures.
csdb := build.MustLoadChecksums("build/checksums.txt")
downloadSpecTestFixtures(csdb, *cachedir)
// downloadSpecTestFixtures(csdb, *cachedir)

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

// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
//
//nolint:unused
func downloadSpecTestFixtures(csdb *build.ChecksumDB, cachedir string) string {
executionSpecTestsVersion, err := build.Version(csdb, "spec-tests")
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions tests/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func TestExecutionSpecBlocktests(t *testing.T) {
t.Skipf("directory %s does not exist", executionSpecBlockchainTestDir)
}
bt := new(testMatcher)

// the deployment is different from go-ethereum
bt.skipLoad("^prague/eip2935_historical_block_hashes_from_state/contract_deployment/system_contract_deployment.json")

bt.walk(t, executionSpecBlockchainTestDir, func(t *testing.T, name string, test *BlockTest) {
execBlockTest(t, bt, test)
})
Expand Down
6 changes: 5 additions & 1 deletion tests/run-evm-tests.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env bash

cd ..
git submodule update --init --depth 1 --recursive
git apply tests/0001-diff-go-ethereum.patch
cd tests
rm -rf spec-tests && mkdir spec-tests && cd spec-tests
wget https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-6%40v1.0.0/fixtures_pectra-devnet-6.tar.gz
tar xzf fixtures_pectra-devnet-6.tar.gz && rm -f fixtures_pectra-devnet-6.tar.gz
cd ..
go test -run . -v >test.log
PASS=`cat test.log |grep "PASS:" |wc -l`
cat test.log|grep FAIL > fail.log
Expand Down

0 comments on commit 80ff00c

Please sign in to comment.