Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/INTEGRATION_FAILURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "bug: long-running integration tests failed"
labels: P-high, T-bug
---

The heavy (long-running) integration tests have failed. This indicates a regression in foundry.

Check the [heavy integration tests workflow page]({{env.WORKFLOW_URL}}) for details.

This issue was raised by the workflow at `.github/workflows/heavy-integration.yml`.
103 changes: 103 additions & 0 deletions .github/workflows/heavy-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Heavy (long-running) integration tests

on:
schedule:
# Runs at 10PM utc
- cron: "0 22 * * *"
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build-tests:
name: build tests / ${{ matrix.archive.name }}
runs-on: ubuntu-latest
strategy:
matrix:
archive:
- name: heavy-integration-tests
file: heavy-integration.tar.zst
flags: -p foundry-cli --features heavy-integration-tests
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@nextest
- name: Build archive (long-running tests)
run: |
cargo nextest archive \
--locked \
--archive-file ${{ matrix.archive.file }} \
${{ matrix.archive.flags }}
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.archive.name }}
path: ${{ matrix.archive.file }}

install-svm-solc:
name: install svm and solidity / ${{ matrix.job.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Install svm
run: cargo install svm-rs
- name: Install Solidity 0.8.19
run: svm install 0.8.19
- name: Install Solidity 0.8.20
run: svm install 0.8.20
- name: Use Solidity 0.8.19
run: svm use 0.8.19

heavy-integration:
name: heavy (long-running) integration tests / ${{ matrix.job.name }}
runs-on: ubuntu-latest
needs: build-tests
strategy:
matrix:
job:
- name: Long-running integration tests
filter: "!test(~live)"
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@nextest
- uses: dtolnay/rust-toolchain@stable
- name: Download archives
uses: actions/download-artifact@v3
with:
name: heavy-integration-tests

- name: Forge RPC cache
uses: actions/cache@v3
if: matrix.job.name != 'non-forking'
with:
path: "$HOME/.foundry/cache"
key: rpc-cache-${{ hashFiles('cli/tests/rpc-cache-keyfile') }}

- name: Setup git config
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "<>"

- name: Force use of HTTPS for submodules
run: git config --global url."https://github.com/".insteadOf "git@github.com:"

- name: cargo nextest
run: |
# see https://github.com/foundry-rs/foundry/pull/3959
export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib"
cargo nextest run --retries 3 --archive-file heavy-integration.tar.zst -E '${{ matrix.job.filter }}'

# If any of the steps fail, this will create a high-priority issue
# to signal so.
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/INTEGRATION_FAILURE.md
3 changes: 3 additions & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ openssl = ["ethers/openssl"]
# feature for integration tests that test external projects
external-integration-tests = []

# feature for heavy (long-running) integration tests
heavy-integration-tests = []

[[bin]]
name = "cast"
path = "src/cast/main.rs"
Expand Down
4 changes: 4 additions & 0 deletions crates/cli/tests/it/heavy_integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// ! Heavy integration tests that can take an hour to run or more.
use foundry_cli_test_utils::forgetest_external;

forgetest_external!(maple, "maple-labs/maple-core-v2");
3 changes: 3 additions & 0 deletions crates/cli/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub(crate) mod forge_utils;
#[cfg(feature = "external-integration-tests")]
mod integration;

#[cfg(feature = "heavy-integration-tests")]
mod heavy_integration;

pub mod constants;

fn main() {}