-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
131 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ jobs: | |
working-directory: ${{github.workspace}} | ||
|
||
- run: npm run coverage | ||
|
||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: ${{ env.cwd }}/coverage/lcov.info | ||
|
@@ -48,7 +48,7 @@ jobs: | |
- run: npm run test:API | ||
- run: npm run test:API:browser | ||
- run: npm run lint | ||
|
||
vm-state: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -132,9 +132,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Args to pass to the tester. Note that some have splitted the slow tests and only | ||
# 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=Istanbul --dir=GeneralStateTests/stTimeConsuming --expected-test-amount=15561', | ||
|
@@ -174,9 +174,9 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Args to pass to the tester. Note that some have splitted the slow tests and only | ||
# 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', | ||
|
@@ -215,6 +215,37 @@ jobs: | |
|
||
- run: npm run test:blockchain -- ${{ matrix.args }} | ||
|
||
vm-backwards-compatibility: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- uses: actions/checkout@v2 | ||
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}} | ||
|
||
# Runs vm test:API with @ethereumjs/[email protected] | ||
- run: npm run check:compatibility -- -t vm -d tx -n @ethereumjs/tx -v "3.0.2" -s test:API | ||
working-directory: ${{github.workspace}} | ||
|
||
vm-benchmarks: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/usr/bin/env bash | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
# A script to test the backwards compatibility of monorepo packages | ||
# with previously published monorepo package sub dependencies. | ||
# | ||
# Substitutes a current package with another version of it installed from npm | ||
# and runs the tests of a package which consumes it. | ||
# | ||
# The monorepo is restored to orignal state after script completes, so this script | ||
# can be run repeatedly for different scenarios in CI | ||
# | ||
# # USAGE | ||
# -t <test> the monorepo package whose tests we'd like to run (ex: vm) | ||
# -d <dependency> the monorepo package dependency we want to swap out (ex: tx) | ||
# -n <npm> the npm package name to swap in (ex: @ethereumjs/tx) | ||
# -v <version> the npm package version to swap in (ex: 3.0.2) | ||
# -s <script> the script to "npm run" to execute the tests | ||
# -------------------------------------------------------------------------------------------------- | ||
|
||
# Exit immediately on error | ||
set -o errexit | ||
|
||
if [ -z "$CI" ]; then | ||
|
||
echo "==================================================================" | ||
echo "This script temporarily alters your deps and might mess things up." | ||
echo "Only run in CI or locally with 'CI=true' " | ||
echo "==================================================================" | ||
|
||
exit 1 | ||
|
||
fi | ||
|
||
# Collect command arguments | ||
while getopts t:d:n:v:s: flag | ||
do | ||
case "${flag}" in | ||
t) tst=${OPTARG};; | ||
d) dep=${OPTARG};; | ||
n) npm=${OPTARG};; | ||
v) ver=${OPTARG};; | ||
s) scr=${OPTARG};; | ||
esac | ||
done | ||
|
||
[ -z $tst ] && echo "Missing -t <test> argument" && exit 1 | ||
[ -z $dep ] && echo "Missing -d <dependency> argument" && exit 1 | ||
[ -z $npm ] && echo "Missing -n <npm> argument" && exit 1 | ||
[ -z $ver ] && echo "Missing -v <version> argument" && exit 1 | ||
[ -z $scr ] && echo "Missing -s <script> argument" && exit 1 | ||
|
||
echo ">> Stashing packages/${dep} in 'stash/'" | ||
|
||
mkdir stash | ||
mv packages/${dep} stash | ||
|
||
echo ">> Installing and staging ${npm}@${ver}" | ||
|
||
mkdir ${dep} | ||
cd ${dep} | ||
npm init --yes | ||
npm install ${npm}@${ver} | ||
mv node_modules/${npm}/* . | ||
|
||
# Comment out by default: Injects a log line into the npm installed | ||
# package to verify that the substitute package is *actually* swapped in | ||
# for the targets tests (by looking at terminal output) | ||
# | ||
# echo ">> Injecting verification log line into line 21 of tx/dist/transaction.js" | ||
# | ||
# sed -i -e $'21 a\\\n'"console.log('>>>>> HELLO!!');" ./dist/transaction.js | ||
|
||
echo ">> Swapping packages/${dep} with ${npm}@${ver} and re-linking" | ||
|
||
cd .. | ||
mv ${dep} packages | ||
lerna link | ||
|
||
echo ">> Executing 'npm run ${scr}' in packages/${tst}" | ||
|
||
cd packages/${tst} | ||
npm run ${scr} | ||
cd ../.. | ||
|
||
echo ">> Un-stashing and relinking packages/${dep}" | ||
|
||
rm -rf packages/${dep} | ||
mv stash/${dep} packages | ||
rm -rf stash | ||
rm -rf ${dep} | ||
lerna link |