Skip to content

Commit d154507

Browse files
authored
feat(tests): add maple as integration test (foundry-rs#5611)
* feat: add maple as integration test * feat: maple yml * chore: set up maple test independently * chore: fmt * docs * chore: rename maple to heavy integration tests * chore: more renaming * chore: create issue on failure * chore: renaming & remove from integration
1 parent 11b08e9 commit d154507

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

.github/INTEGRATION_FAILURE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "bug: long-running integration tests failed"
3+
labels: P-high, T-bug
4+
---
5+
6+
The heavy (long-running) integration tests have failed. This indicates a regression in foundry.
7+
8+
Check the [heavy integration tests workflow page]({{env.WORKFLOW_URL}}) for details.
9+
10+
This issue was raised by the workflow at `.github/workflows/heavy-integration.yml`.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Heavy (long-running) integration tests
2+
3+
on:
4+
schedule:
5+
# Runs at 10PM utc
6+
- cron: "0 22 * * *"
7+
workflow_dispatch:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build-tests:
14+
name: build tests / ${{ matrix.archive.name }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
archive:
19+
- name: heavy-integration-tests
20+
file: heavy-integration.tar.zst
21+
flags: -p foundry-cli --features heavy-integration-tests
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@stable
25+
- uses: Swatinem/rust-cache@v2
26+
- uses: taiki-e/install-action@nextest
27+
- name: Build archive (long-running tests)
28+
run: |
29+
cargo nextest archive \
30+
--locked \
31+
--archive-file ${{ matrix.archive.file }} \
32+
${{ matrix.archive.flags }}
33+
- name: Upload archive
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: ${{ matrix.archive.name }}
37+
path: ${{ matrix.archive.file }}
38+
39+
install-svm-solc:
40+
name: install svm and solidity / ${{ matrix.job.name }}
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 30
43+
steps:
44+
- name: Install svm
45+
run: cargo install svm-rs
46+
- name: Install Solidity 0.8.19
47+
run: svm install 0.8.19
48+
- name: Install Solidity 0.8.20
49+
run: svm install 0.8.20
50+
- name: Use Solidity 0.8.19
51+
run: svm use 0.8.19
52+
53+
heavy-integration:
54+
name: heavy (long-running) integration tests / ${{ matrix.job.name }}
55+
runs-on: ubuntu-latest
56+
needs: build-tests
57+
strategy:
58+
matrix:
59+
job:
60+
- name: Long-running integration tests
61+
filter: "!test(~live)"
62+
env:
63+
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
64+
steps:
65+
- uses: actions/checkout@v3
66+
- uses: taiki-e/install-action@nextest
67+
- uses: dtolnay/rust-toolchain@stable
68+
- name: Download archives
69+
uses: actions/download-artifact@v3
70+
with:
71+
name: heavy-integration-tests
72+
73+
- name: Forge RPC cache
74+
uses: actions/cache@v3
75+
if: matrix.job.name != 'non-forking'
76+
with:
77+
path: "$HOME/.foundry/cache"
78+
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}
79+
80+
- name: Setup git config
81+
run: |
82+
git config --global user.name "GitHub Actions Bot"
83+
git config --global user.email "<>"
84+
85+
- name: Force use of HTTPS for submodules
86+
run: git config --global url."https://github.com/".insteadOf "[email protected]:"
87+
88+
- name: cargo nextest
89+
run: |
90+
# see https://github.com/foundry-rs/foundry/pull/3959
91+
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
92+
cargo nextest run --retries 3 --archive-file heavy-integration.tar.zst -E '${{ matrix.job.filter }}'
93+
94+
# If any of the steps fail, this will create a high-priority issue
95+
# to signal so.
96+
- uses: JasonEtco/create-an-issue@v2
97+
if: ${{ failure() }}
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
101+
with:
102+
update_existing: true
103+
filename: .github/INTEGRATION_FAILURE.md

crates/cli/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ openssl = ["ethers/openssl"]
9898
# feature for integration tests that test external projects
9999
external-integration-tests = []
100100

101+
# feature for heavy (long-running) integration tests
102+
heavy-integration-tests = []
103+
101104
[[bin]]
102105
name = "cast"
103106
path = "src/cast/main.rs"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// ! Heavy integration tests that can take an hour to run or more.
2+
use foundry_cli_test_utils::forgetest_external;
3+
4+
forgetest_external!(maple, "maple-labs/maple-core-v2");

crates/cli/tests/it/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ pub(crate) mod forge_utils;
3030
#[cfg(feature = "external-integration-tests")]
3131
mod integration;
3232

33+
#[cfg(feature = "heavy-integration-tests")]
34+
mod heavy_integration;
35+
3336
pub mod constants;
3437

3538
fn main() {}

0 commit comments

Comments
 (0)