Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solidity Tests feature branch CI #524

Draft
wants to merge 92 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
318a25e
chore: fork Foundry Forge (#466)
agostbiro May 27, 2024
caf4906
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro May 27, 2024
45ca3ec
ci: custom release profile for edr_napi (#476)
agostbiro May 28, 2024
3c57ddb
Merge branch 'main' into feat/solidity-tests
agostbiro May 29, 2024
cc0f307
chore: remove `foundry-wallets` and `script` cheatcode (#477)
agostbiro May 31, 2024
2e891cb
Merge branch 'main' into feat/solidity-tests
agostbiro May 31, 2024
13857a0
docs: add cheatcode docs (#478)
agostbiro May 31, 2024
4ec7518
fix: fix eth_feeHistory result deserialization (#484)
agostbiro May 31, 2024
4119750
test: execute solidity tests through napi (#474)
agostbiro Jun 11, 2024
5f79eed
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Jun 18, 2024
e9228c7
Add Solidity tests JS benchmark (#506)
agostbiro Jun 20, 2024
736a018
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Jun 20, 2024
e1eeb28
refactor: remove `foundry_config::Config` dep from `MultiContractRunn…
agostbiro Jul 10, 2024
44702ee
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Jul 10, 2024
cfbb610
ci: add regression checks for feature branch
agostbiro Jul 10, 2024
70d06c1
ci: remove path checks for benchmarks
agostbiro Jul 11, 2024
2d881c8
ci: remove path restrictions for feature branch benchmark
agostbiro Jul 11, 2024
9bcfaf3
Fix pull request branch filter
agostbiro Jul 12, 2024
236112c
feat: use cancun by default in solidity tests runner (#554)
fvictorio Jul 16, 2024
2562904
edr-0.4.2 (#540)
github-actions[bot] Jul 11, 2024
093040e
ci: remove path restrictions for EDR jobs (#551)
agostbiro Jul 11, 2024
8772326
ci: check that index.d.ts is up to date (#553)
fvictorio Jul 16, 2024
2378037
refactor: assert scheduling callback succeeded (#556)
agostbiro Jul 17, 2024
a03d0a8
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Jul 22, 2024
125cee4
refactor: remove `ProjectPathsConfig` from `MultiContractRunner` (#561)
agostbiro Jul 22, 2024
1a774eb
chore: move hardhat-solidity-tests to the EDR repo (#560)
fvictorio Jul 22, 2024
7a0dabf
refactor: Solidity test runner progress callback completion (#563)
agostbiro Jul 30, 2024
9732177
refactor: decouple Foundry project layout and build system (#572)
agostbiro Aug 1, 2024
9c8640d
Merge branch 'main' into feat/solidity-tests
agostbiro Aug 1, 2024
cf27f7f
Merge branch 'main' into feat/solidity-tests
agostbiro Aug 6, 2024
103f3b1
refactor: remove verbosity config (#581)
agostbiro Aug 6, 2024
1845b6a
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Aug 12, 2024
903fb9d
test: fix deposit WETH test (#598)
agostbiro Aug 13, 2024
c6d955c
feat: solidity test runner config (#592)
agostbiro Aug 16, 2024
cd7b5b2
tests: remove unused fixtures (#604)
agostbiro Aug 19, 2024
c260001
Merge main into feat/solidity-tests (#616)
fvictorio Aug 22, 2024
acc1a3b
Merge branch 'main' into feat/solidity-tests
fvictorio Aug 22, 2024
1dcdf24
fix: build edr_napi with test profile when running hardhat tests (#620)
fvictorio Aug 23, 2024
113893d
refactor: remove Foundry `test-utils` crate (#619)
agostbiro Aug 23, 2024
7845ddc
test: default to cancun in forge integration tests (#622)
agostbiro Aug 23, 2024
1e47343
test: enable cheatcode tests (#623)
agostbiro Aug 26, 2024
322bcec
refactor: remove inline fuzz config (#624)
agostbiro Aug 26, 2024
ea913d1
refactor: remove usages of `foundry-config` from `foundry-common` (#627)
agostbiro Aug 28, 2024
0748836
refactor: remove etherscan identifier (#628)
agostbiro Aug 28, 2024
8fcf891
feat: rpc cache path for Solidity tests (#629)
agostbiro Aug 28, 2024
660541d
test: add js integration test for solidity test runner (#634)
fvictorio Sep 2, 2024
dfb8659
refactor: use same code path and config for Solidity test runner inte…
agostbiro Sep 5, 2024
8c6842c
test: use correct cheatcode interface in tests (#644)
agostbiro Sep 5, 2024
d57b367
Merge branch 'refs/heads/main' into feat/solidity-tests
agostbiro Sep 9, 2024
adaf1bf
refactor: remove loading from disk for get code (#645)
agostbiro Sep 9, 2024
01e2453
feat: optional `testFail` support (#648)
agostbiro Sep 10, 2024
f09f9a3
test: add JS integration tests for Solidity unit tests (#650)
agostbiro Sep 10, 2024
aa34d48
test: add isolate mode JS integration test (#652)
agostbiro Sep 12, 2024
d7c1472
test: add `testFail` JS integration test (#655)
agostbiro Sep 12, 2024
9c0bad0
Merge branch 'main' into feat/solidity-tests
agostbiro Sep 13, 2024
660428c
test: add JS fuzz/invariant integration tests (#658)
agostbiro Sep 13, 2024
eca51eb
test: add env var JS integration test (#662)
agostbiro Sep 13, 2024
b164398
feat: disable fuzz fixtures in Solidity (#661)
agostbiro Sep 13, 2024
8e0bb80
refactor: remove unused code from foundry_common (#667)
agostbiro Sep 17, 2024
d5eceb0
Merge branch 'main' into feat/solidity-tests
agostbiro Sep 17, 2024
8db9adf
refactor: remove the debugger feature (#668)
agostbiro Sep 17, 2024
058cbf6
refactor: remove foundry config and linking crates (#670)
agostbiro Sep 17, 2024
fc38cb4
refactor: clean up `foundry_common` and rename crates (#672)
agostbiro Sep 20, 2024
9e22766
Merge branch 'main' into feat/solidity-tests
agostbiro Sep 23, 2024
44490c2
refactor: adapt isContext cheatcode (#674)
agostbiro Sep 24, 2024
565bd1e
chore: use @ignored npm namespace (#683)
fvictorio Sep 25, 2024
ba23291
edr-0.6.2-alpha.0
fvictorio Sep 25, 2024
b9740bf
edr-0.6.2-alpha.0
fvictorio Sep 25, 2024
2c76000
edr-0.6.2-alpha.0
fvictorio Sep 25, 2024
c679b68
Merge branch 'main' into feat/solidity-tests
agostbiro Sep 26, 2024
a004ee5
ci: solidity test benchmarks (#686)
agostbiro Oct 1, 2024
ae8625f
Fix precondition for soltests benchmark
agostbiro Oct 1, 2024
eea9dc4
Merge branch 'main' into feat/solidity-tests
agostbiro Oct 16, 2024
3700823
Merge branch 'main' into feat/solidity-tests
agostbiro Oct 21, 2024
7aaf746
fix: report config error on invalid artifact (#704)
agostbiro Oct 22, 2024
502d3fb
fix: return empty result for empty test suite (#705)
agostbiro Oct 22, 2024
0e26b21
edr-0.6.4-alpha.0
agostbiro Oct 22, 2024
4e7491d
chore: upgrade soltest crates to revm 9 (#708)
agostbiro Oct 24, 2024
fc4064b
chore(deps): bump revm 10.0, un-git revm-inspectors (#8220) (#711)
agostbiro Oct 24, 2024
6b288fd
chore: bump alloy and add `foundry-fork-db` (#712)
agostbiro Oct 25, 2024
867fff5
chore: remove hardcoded Alchemy urls (#707)
iosh Oct 25, 2024
56b795a
refactor: refactor coverage analysis (#713)
agostbiro Oct 25, 2024
dd33f1d
chore: bump revm-inspectors (#717)
agostbiro Oct 28, 2024
6aa79e3
chore: fix cheatcode tests (#716)
agostbiro Oct 28, 2024
a6f3de6
chore: get network config from foundry.toml (#715)
iosh Oct 28, 2024
86c3cf7
chore: delegate trace formatting to `revm-inspectors` (#718)
agostbiro Oct 29, 2024
bbb9147
chore: bump revm (#719)
agostbiro Oct 29, 2024
49835fe
Merge branch 'main' into feat/solidity-tests
agostbiro Oct 30, 2024
20e290f
edr-0.6.4-alpha.1
agostbiro Oct 31, 2024
8e88733
Merge branch 'main' into feat/solidity-tests
agostbiro Nov 6, 2024
828fb40
edr-0.6.4-alpha.2
agostbiro Nov 6, 2024
4d7c0d2
Merge branch 'main' into feat/solidity-tests
agostbiro Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ gen-execution-api = "run --bin tools -- gen-execution-api"
scenario = "run --release --bin tools -- scenario"
scenario-with-tracing = "run --release --features tracing --bin tools -- scenario"
replay-block = "run --release --bin tools -- replay-block"
generate-cheats-interface = "test -p foundry-cheatcodes-spec --features schema tests::"
22 changes: 22 additions & 0 deletions .github/scripts/cargo-doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

# For EDR crates, test that docs build and they don't have warnings
for dir in crates/edr_*/ ; do
if [ -d "$dir" ]; then
pushd "$dir" > /dev/null
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features
popd > /dev/null
fi
done

# For Foundry crates, only test that docs build and allow linking to private items
for dir in crates/foundry/* ; do
if [ -d "$dir" ]; then
pushd "$dir" > /dev/null
cargo doc --all-features --no-deps --document-private-items
popd > /dev/null
fi
done

13 changes: 13 additions & 0 deletions .github/scripts/cargo-hack-edr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

# Execute cargo hack only for EDR crates
for dir in crates/edr_*/ ; do
if [ -d "$dir" ]; then
pushd "$dir" > /dev/null
cargo hack check --feature-powerset --exclude-no-default-features --no-dev-deps
popd > /dev/null
fi
done

90 changes: 90 additions & 0 deletions .github/workflows/edr-benchmark-feat-solidity-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: EDR Benchmarks for feat/solidity-tests

on:
push:
branches:
- "feat/solidity-tests"
pull_request:
branches:
- "**"
workflow_dispatch:

defaults:
run:
working-directory: crates/tools/js/benchmark

concurrency:
group: ${{github.workflow}}-${{github.ref}}
# Don't cancel in progress jobs in main
cancel-in-progress: ${{ github.ref != 'refs/heads/feat/solidity-tests' }}

jobs:
benchmarks-test:
name: Benchmarks test
environment: github-action-benchmark
runs-on: self-hosted
# Only run for trusted collaborators since third-parties could run malicious code on the self-hosted benchmark runner.
if: github.ref == 'refs/heads/feat/solidity-tests' || github.repository == github.event.pull_request.head.repo.full_name
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust

- name: Install packages
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark tests
run: pnpm test

js-scenario-benchmark:
name: Run JS scenario runner benchmark for Hardhat Node style workload
environment: github-action-benchmark
runs-on: self-hosted
needs: benchmarks-test
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust

- name: Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
save-always: true
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install packages
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark
run: pnpm run benchmark

- name: Validate regressions
run: pnpm run verify

- name: Generate report for github-action-benchmark
run: pnpm run --silent report | tee scenario-report.json

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: crates/tools/js/benchmark/scenario-report.json
gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results
gh-pages-branch: feat/solidity-tests
benchmark-data-dir-path: bench
github-token: ${{ secrets.BENCHMARK_GITHUB_TOKEN }}
# Only save the data for main branch pushes. For PRs we only compare
auto-push: ${{ github.ref == 'refs/heads/feat/solidity-tests' && github.event_name != 'pull_request' }}
alert-threshold: "110%"
# Only fail on pull requests, don't break CI in main
fail-on-alert: ${{ github.event_name == 'pull_request' }}
# Enable Job Summary for PRs
summary-always: true
max-items-in-chart: 1000
110 changes: 99 additions & 11 deletions .github/workflows/edr-benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: EDR Benchmark
name: EDR Benchmarks

on:
push:
branches:
- main
# TODO: change to `main` when we merging to main
# https://github.com/NomicFoundation/edr/issues/685
- "feat/solidity-tests"
pull_request:
branches:
- "**"
Expand All @@ -16,40 +18,70 @@ defaults:
concurrency:
group: ${{github.workflow}}-${{github.ref}}
# Don't cancel in progress jobs in main
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
# TODO: change to `main` when we merging to main
# https://github.com/NomicFoundation/edr/issues/685
cancel-in-progress: ${{ github.ref != 'refs/heads/feat/solidity-tests' }}

jobs:
js-benchmark:
name: Run JS scenario runner benchmark
benchmarks-test:
name: Benchmarks test
environment: github-action-benchmark
runs-on: self-hosted
# Only run for trusted collaborators since third-parties could run malicious code on the self-hosted benchmark runner.
if: github.ref == 'refs/heads/main' || github.repository == github.event.pull_request.head.repo.full_name
# TODO: change ref comparison to `main` when we merging to main
# https://github.com/NomicFoundation/edr/issues/685
if: github.ref == 'refs/heads/feat/solidity-tests' || github.repository == github.event.pull_request.head.repo.full_name
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust

- name: Install package
- name: Install packages
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark tests
run: pnpm test

js-scenario-benchmark:
name: Run JS scenario runner benchmark for Hardhat Node style workload
environment: github-action-benchmark
runs-on: self-hosted
needs: benchmarks-test
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust

- name: Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
save-always: true
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install packages
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark
run: pnpm run -s benchmark
run: pnpm run benchmark

- name: Validate regressions
run: pnpm run -s verify
run: pnpm run verify

- name: Generate report for github-action-benchmark
run: pnpm run -s report | tee report.json
run: pnpm run --silent report | tee scenario-report.json

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: crates/tools/js/benchmark/report.json
output-file-path: crates/tools/js/benchmark/scenario-report.json
gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results
gh-pages-branch: main
benchmark-data-dir-path: bench
Expand All @@ -62,3 +94,59 @@ jobs:
# Enable Job Summary for PRs
summary-always: true
max-items-in-chart: 1000

js-soltests-benchmark:
name: Run JS Solidity test runner benchmark
environment: github-action-benchmark
runs-on: self-hosted
needs: benchmarks-test
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/setup-rust

- name: Cache EDR RPC cache
uses: actions/cache@v4
with:
path: |
**/edr-cache
key: edr-rs-rpc-cache-v1

- name: Rust cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
save-always: true
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install packages
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark and generate report for github-action-benchmark
run: pnpm run --silent soltests | tee soltest-report.json

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: customSmallerIsBetter
output-file-path: crates/tools/js/benchmark/soltest-report.json
gh-repository: github.com/nomic-foundation-automation/edr-benchmark-results
gh-pages-branch: main
benchmark-data-dir-path: soltests
github-token: ${{ secrets.BENCHMARK_GITHUB_TOKEN }}
# Only save the data for main branch pushes. For PRs we only compare
# TODO: change to `main` when we merging to main
# https://github.com/NomicFoundation/edr/issues/685
auto-push: ${{ github.ref == 'refs/heads/feat/solidity-tests' && github.event_name != 'pull_request' }}
alert-threshold: "110%"
# Only fail on pull requests, don't break CI in main
fail-on-alert: ${{ github.event_name == 'pull_request' }}
# Enable Job Summary for PRs
summary-always: true
max-items-in-chart: 1000
36 changes: 30 additions & 6 deletions .github/workflows/edr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings

concurrency:
group: ${{github.workflow}}-${{github.ref}}
Expand All @@ -28,7 +27,14 @@ jobs:
# Install pre-built binaries for cargo hack
- uses: taiki-e/install-action@cargo-hack

- run: cargo hack check --feature-powerset --no-dev-deps
- name: Cargo check no default features for all crates
run: cargo check --all --no-default-features

- name: Cargo hack for EDR crates
run: |
chmod +x ./.github/scripts/cargo-hack-edr.sh
./.github/scripts/cargo-hack-edr.sh
shell: bash

test-edr-rs:
name: Test EDR (${{ matrix.os }})
Expand Down Expand Up @@ -107,17 +113,22 @@ jobs:
- uses: ./.github/actions/setup-rust

- name: Cargo doc
run: cargo doc --workspace --no-deps --all-features
run: |
chmod +x ./.github/scripts/cargo-doc.sh
./.github/scripts/cargo-doc.sh
shell: bash

lint:
name: Run Prettier
build-and-lint:
name: Build and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run build script
run: pnpm run build:dev
- name: Run lint script
run: pnpm run lint

Expand All @@ -132,7 +143,20 @@ jobs:
run: pnpm install --frozen-lockfile --prefer-offline

- name: Build edr_napi
run: cd crates/edr_napi && pnpm build
run: cd crates/edr_napi && pnpm build:dev

- name: Check that there are no uncommitted changes
run: git diff --exit-code

edr-integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node

- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run integration tests
run: pnpm run --recursive --filter './js/integration-tests/*' test
Loading
Loading