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

feat: local integration tests #70

Merged
merged 93 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e8967a2
add integration test scratch
qalisander May 7, 2024
2cf7a19
add utils and infrastructure
qalisander May 7, 2024
0b7a428
add erc721 tests
qalisander May 7, 2024
d169206
add erc721 example
qalisander May 9, 2024
f192dfe
remove integration from default members
qalisander May 9, 2024
9681d03
remove receive_context test
qalisander May 9, 2024
a7fa6d8
restructure infrastructure
qalisander May 9, 2024
4cee5ef
rename to alice and bob
qalisander May 9, 2024
3523348
++
qalisander May 9, 2024
8672015
use private keys not path
qalisander May 10, 2024
1da57fd
have stylus deployment address as associated const
qalisander May 10, 2024
ae44f17
add mint to erc721 example
qalisander May 10, 2024
3def92f
add integration test script
qalisander May 13, 2024
04a3749
remove dotenv from deps
qalisander May 13, 2024
1012f10
add send and call with function context
qalisander May 13, 2024
4a2c4f1
++
qalisander May 13, 2024
e4a9e76
add auto deployment of every contract at example dir
qalisander May 14, 2024
21b9d1b
add erc20-example test
qalisander May 14, 2024
7a6dd90
++
qalisander May 14, 2024
6282bd0
add integration workflow
qalisander May 15, 2024
f8e2af7
add more docs
qalisander May 15, 2024
00c4e3c
Merge remote-tracking branch 'refs/remotes/origin/main' into integrat…
qalisander May 16, 2024
dc6697c
fix fmt
qalisander May 16, 2024
b1d3374
++
qalisander May 16, 2024
d226068
++
qalisander May 16, 2024
bf17c7d
++
qalisander May 16, 2024
859219e
use bash instead zsh
qalisander May 16, 2024
71795e7
refactor erc721 integration tests
qalisander May 16, 2024
25605c8
add token_imp! macro
qalisander May 16, 2024
8193953
remove --workspace flags
qalisander May 16, 2024
62b5c4f
revert shims for stylus 0.4.3
qalisander May 16, 2024
c1b2fee
++
qalisander May 16, 2024
5596f3b
remove token bridge
qalisander May 16, 2024
b970115
refactor
qalisander May 17, 2024
097027b
++
qalisander May 17, 2024
caebc20
++
qalisander May 18, 2024
e596b70
++
qalisander May 18, 2024
a2a63fb
Merge remote-tracking branch 'refs/remotes/origin/main' into local-in…
qalisander May 18, 2024
cdb90a5
++
qalisander May 18, 2024
075b110
++
qalisander May 18, 2024
9d84cfe
++
qalisander May 20, 2024
56f09f3
Merge remote-tracking branch 'refs/remotes/origin/main' into local-in…
qalisander May 20, 2024
2abc5a7
++
qalisander May 20, 2024
3d42455
++
qalisander May 20, 2024
d517352
Update .github/workflows/integration.yml
qalisander May 20, 2024
e4dfa8d
++
qalisander May 20, 2024
051f8cf
++
qalisander May 20, 2024
990c47d
++
qalisander May 20, 2024
13d825d
++
qalisander May 20, 2024
61beba0
++
qalisander May 20, 2024
cf86913
++
qalisander May 20, 2024
14fde20
++
qalisander May 20, 2024
3a98031
++
qalisander May 20, 2024
5ddbc7b
++
qalisander May 20, 2024
641b153
++
qalisander May 21, 2024
e6143c4
Merge remote-tracking branch 'refs/remotes/origin/main' into local-in…
qalisander May 21, 2024
5ee3fb6
++
qalisander May 21, 2024
2b2698a
fix erc721 exceeding wasm binary size
qalisander May 22, 2024
20b4295
Merge remote-tracking branch 'refs/remotes/origin/main' into local-in…
qalisander May 22, 2024
5989f49
++
qalisander May 22, 2024
cc2fd3a
++
qalisander May 22, 2024
d425626
++
qalisander May 22, 2024
941a1d6
++
qalisander May 22, 2024
1244f29
++
qalisander May 22, 2024
5c4f588
++
qalisander May 22, 2024
93acbf0
++
qalisander May 22, 2024
b9be1e5
++
qalisander May 23, 2024
b8b7d02
++
qalisander May 23, 2024
c32ccbd
++
qalisander May 23, 2024
51c1062
++
qalisander May 23, 2024
8ad936f
++
qalisander May 23, 2024
16c9e28
++
qalisander May 23, 2024
1375a99
Merge remote-tracking branch 'refs/remotes/origin/main' into local-in…
qalisander May 23, 2024
e9a75b7
++
qalisander May 23, 2024
30dec61
++
qalisander May 23, 2024
3c1d005
++
qalisander May 23, 2024
ed6209c
++
qalisander May 23, 2024
e411132
++
qalisander May 23, 2024
be23a7a
++
qalisander May 23, 2024
e400061
Update e2e-tests/src/context/mod.rs
qalisander May 23, 2024
a50af55
++
qalisander May 23, 2024
aea120b
++
qalisander May 23, 2024
562d644
++
qalisander May 23, 2024
fd0c102
++
qalisander May 23, 2024
5039042
++
qalisander May 23, 2024
787cd71
++
qalisander May 23, 2024
a050b15
++
qalisander May 23, 2024
317dbd3
++
qalisander May 23, 2024
d8447cf
++
qalisander May 23, 2024
9bf995d
++
qalisander May 23, 2024
d8f8a76
++
qalisander May 23, 2024
05a74f2
++
qalisander May 23, 2024
403f904
++
qalisander May 23, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Install nightly
uses: dtolnay/rust-toolchain@nightly
- name: cargo doc
run: cargo doc --workspace --no-deps --all-features
run: cargo doc --no-deps --all-features
qalisander marked this conversation as resolved.
Show resolved Hide resolved
env:
RUSTDOCFLAGS: --cfg docsrs
hack:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: e2e-tests
# This workflow runs our end-to-end tests suite.
#
# It roughly follows these steps:
# - A local `nitro-testnode` gets spun up.
# - Contracts get deployed to the local node.
# - A few addresses get funded.
# - The test suite runs.
permissions:
contents: read
on:
push:
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
e2e-tests:
name: integration tests suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: cache cargo-stylus
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
key: ${{ runner.os }}[email protected]
save-always: true

- name: set up rust
uses: dtolnay/rust-toolchain@master
id: toolchain
with:
target: wasm32-unknown-unknown
components: rust-src
toolchain: nightly-2024-01-01

- name: install cargo-stylus
run: RUSTFLAGS="-C link-args=-rdynamic" cargo install [email protected]

- name: setup nitro node
run: |
# clone nitro test node repo
git clone -b stylus --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git && cd nitro-testnode
git checkout 1886f4b89f5c20fd5b0c2cf3d08a009ee73e45ca

# setup nitro test node
./test-node.bash --no-run --init --no-tokenbridge
./test-node.bash --detach

# TODO: remove hard coded wallets when user creation will be per test case
# fund Alice's wallet
./test-node.bash script send-l2 --to address_0x01fA6bf4Ee48B6C95900BCcf9BEA172EF5DBd478 --ethamount 10000
# fund Bob's wallet
./test-node.bash script send-l2 --to address_0xF4EaCDAbEf3c8f1EdE91b6f2A6840bc2E4DD3526 --ethamount 10000

- name: run integration tests
run: |
export NIGHTLY_TOOLCHAIN=${{steps.toolchain.outputs.name}}
./e2e-tests/test.sh
6 changes: 3 additions & 3 deletions .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permissions:
contents: read
on:
push:
branches: [main]
branches: [ main ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -19,7 +19,7 @@ jobs:
name: ${{ matrix.target }}
strategy:
matrix:
target: [wasm32-unknown-unknown]
target: [ wasm32-unknown-unknown ]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -29,4 +29,4 @@ jobs:
- name: rustup target add ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: cargo check
run: cargo check --release --target ${{ matrix.target }} --no-default-features --workspace --all-features
qalisander marked this conversation as resolved.
Show resolved Hide resolved
run: cargo check --release --target ${{ matrix.target }} --no-default-features --all-features
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
contents: read
on:
push:
branches: [main]
branches: [ main ]
paths-ignore:
- "**.md"
- "**.adoc"
Expand All @@ -34,7 +34,7 @@ jobs:
matrix:
# Run on stable and beta to ensure that tests won't break on the next
# version of the rust toolchain.
toolchain: [stable, beta]
toolchain: [ stable, beta ]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -50,18 +50,18 @@ jobs:
run: cargo generate-lockfile
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
run: cargo test --locked --all-features --all-targets --workspace
run: cargo test --locked --all-features --all-targets
# https://github.com/rust-lang/cargo/issues/6669
- name: cargo test --doc
run: cargo test --locked --all-features --doc --workspace
run: cargo test --locked --all-features --doc
os-check:
# Run cargo test on MacOS and Windows.
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / stable
strategy:
fail-fast: false
matrix:
os: [macos-latest]
os: [ macos-latest ]
# Windows fails because of `stylus-proc`.
# os: [macos-latest, windows-latest]
steps:
Expand All @@ -74,7 +74,7 @@ jobs:
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo test
run: cargo test --locked --all-features --all-targets --workspace
qalisander marked this conversation as resolved.
Show resolved Hide resolved
run: cargo test --locked --all-features --all-targets
coverage:
# Use llvm-cov to build and collect coverage and outputs in a format that
# is compatible with codecov.io.
Expand Down
Loading
Loading