Skip to content

Commit

Permalink
Merge pull request #951 from ethereumjs/ci/vm-tests-on-demand
Browse files Browse the repository at this point in the history
On-demand testing for VM State and Blockchain
  • Loading branch information
holgerd77 authored Nov 17, 2020
2 parents 11eb16f + c0dd7ee commit c188339
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 24 deletions.
112 changes: 92 additions & 20 deletions .github/workflows/vm-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
working-directory: packages/vm

jobs:
test-vm-api:
vm-api:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
Expand Down Expand Up @@ -49,21 +49,13 @@ jobs:
- run: npm run test:API:browser
- run: npm run lint

test-vm-state:
vm-state:
runs-on: ubuntu-latest
strategy:
matrix:
fork: [
# 'Berlin',
'MuirGlacier',
'Istanbul',
# 'Petersburg',
# 'Constantinople',
# 'Byzantium',
# 'SpuriousDragon',
# 'TangerineWhistle',
# 'Homestead',
# 'Chainstart'
'Istanbul'
]
fail-fast: false
steps:
Expand Down Expand Up @@ -93,7 +85,49 @@ jobs:

- run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests

test-vm-blockchain:
vm-state-extended:
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
runs-on: ubuntu-latest
strategy:
matrix:
fork: [
'Berlin',
'Petersburg',
'Constantinople',
'Byzantium',
'SpuriousDragon',
'TangerineWhistle',
'Homestead',
'Chainstart'
]
fail-fast: false
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: VM-${{ runner.os }}-12-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
working-directory: ${{github.workspace}}

- run: npm run test:state -- --fork=${{ matrix.fork }} --verify-test-amount-alltests

vm-blockchain:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -102,15 +136,53 @@ jobs:

# Tests were splitted with --dir and --excludeDir to balance execution times below the 9min mark.
args: [
# '--fork=Berlin --expected-test-amount=33',
'--fork=Istanbul --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
'--fork=Istanbul --excludeDir=stTimeConsuming --expected-test-amount=19817',
# '--fork=Constantinople --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
# '--fork=Constantinople --excludeDir=stTimeConsuming --expected-test-amount=17193',
# '--fork=Petersburg --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
# '--fork=Petersburg --excludeDir=stTimeConsuming --expected-test-amount=17174',
# '--fork=Homestead --expected-test-amount=6997',
# '--fork=Chainstart --expected-test-amount=4385'
'--fork=Istanbul --excludeDir=stTimeConsuming --expected-test-amount=19817'
]
fail-fast: false
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Dependency cache
uses: actions/cache@v2
id: cache
with:
key: VM-${{ runner.os }}-12-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
working-directory: ${{github.workspace}}

- run: npm run test:blockchain -- ${{ matrix.args }}

vm-blockchain-extended:
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'Test all hardforks')
runs-on: ubuntu-latest
strategy:
matrix:
# Args to pass to the tester. Note that some have splitted the slow tests and only
# running those: these are only on forks where that is applicable (see PR #489 for numbers on these)

# Tests were splitted with --dir and --excludeDir to balance execution times below the 9min mark.
args: [
'--fork=Berlin --expected-test-amount=33',
'--fork=Constantinople --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
'--fork=Constantinople --excludeDir=stTimeConsuming --expected-test-amount=17193',
'--fork=Petersburg --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561',
'--fork=Petersburg --excludeDir=stTimeConsuming --expected-test-amount=17174',
'--fork=Homestead --expected-test-amount=6997',
'--fork=Chainstart --expected-test-amount=4385'
]
fail-fast: false
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "ethereum-tests"]
path = ethereum-tests
path = packages/ethereum-tests
url = https://github.com/ethereum/tests.git
branch = develop
1 change: 0 additions & 1 deletion ethereum-tests
Submodule ethereum-tests deleted from bfcd07
1 change: 1 addition & 0 deletions packages/ethereum-tests
Submodule ethereum-tests added at 66a55c
2 changes: 1 addition & 1 deletion packages/tx/test/testLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path')

const falsePredicate = () => false
// Load tests from git submodule
const defaultTestsPath = path.resolve('../../ethereum-tests')
const defaultTestsPath = path.resolve('../ethereum-tests')
/**
* Returns the list of test files matching the given parameters
* @param testType the test type (path segment)
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/tests/testLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path')

const falsePredicate = () => false
// Load tests from git submodule
const defaultTestsPath = path.resolve('../../ethereum-tests')
const defaultTestsPath = path.resolve('../ethereum-tests')
/**
* Returns the list of test files matching the given parameters
* @param testType the test type (path segment)
Expand Down

0 comments on commit c188339

Please sign in to comment.