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: integrate koba & migrate e2e tests to alloy #80

Merged
merged 90 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
48d7190
feat: add constructor for erc20-example
alexfertel May 23, 2024
e7e30cf
feat: add constructors for the rest of the examples
alexfertel May 23, 2024
5eb4af1
fix: remove remaining references to constructors
alexfertel May 23, 2024
823b471
Merge branch 'main' into constructors
alexfertel May 23, 2024
ba776e8
Merge branch 'main' into constructors
alexfertel May 25, 2024
4a9a847
feat: add koba as a git dependency
alexfertel May 25, 2024
e775135
feat: replace ethers with alloy
alexfertel May 26, 2024
ffd3016
Merge branch 'migrate-tests-to-alloy' into constructors
alexfertel May 26, 2024
e0f7e6c
feat: add erc20-example integration tests' setup
alexfertel May 26, 2024
ed35ae4
fix: wip
alexfertel May 26, 2024
cc36c5f
wip
alexfertel May 26, 2024
b92c225
wip
alexfertel May 26, 2024
64ff2fc
fix: properly parse private keys
alexfertel May 27, 2024
f4e4a93
fix: properly set pkg name
alexfertel May 27, 2024
217f45c
dbg
alexfertel May 27, 2024
1363e41
wip
alexfertel May 27, 2024
e950399
dbg
alexfertel May 27, 2024
0265316
dbg
alexfertel May 27, 2024
2aa6814
dbg
alexfertel May 27, 2024
6d0a482
dbg
alexfertel May 27, 2024
8089f67
dbg
alexfertel May 27, 2024
f819ffd
dbg
alexfertel May 27, 2024
b31c682
dbg
alexfertel May 27, 2024
baaf3e8
dbg
alexfertel May 27, 2024
97ce174
dbg
alexfertel May 27, 2024
1f6dcba
dbg
alexfertel May 27, 2024
7fbc015
dbg
alexfertel May 27, 2024
6b9e5cf
dbg
alexfertel May 27, 2024
7048386
dbg
alexfertel May 27, 2024
6833d96
dbg
alexfertel May 27, 2024
3f7e4cf
dbg
alexfertel May 27, 2024
c28d12f
dbg
alexfertel May 27, 2024
29d8016
dbg
alexfertel May 27, 2024
1a7237f
dbg
alexfertel May 27, 2024
54a7477
dbg
alexfertel May 27, 2024
c0e558c
dbg
alexfertel May 27, 2024
be4053e
dbg
alexfertel May 27, 2024
8a90a18
dbg
alexfertel May 27, 2024
50bbc79
dbg
alexfertel May 27, 2024
644a871
dbg
alexfertel May 27, 2024
f5280fc
dbg
alexfertel May 27, 2024
b35b215
dbg
alexfertel May 27, 2024
c10cd20
dbg
alexfertel May 27, 2024
380bffe
dbg
alexfertel May 27, 2024
bf7e79c
dbg
alexfertel May 27, 2024
934d355
dbg
alexfertel May 27, 2024
fd503ec
dbg
alexfertel May 27, 2024
5d45c6a
dbg
alexfertel May 27, 2024
cc55fd6
dbg
alexfertel May 27, 2024
298add6
dbg
alexfertel May 27, 2024
50cfb2d
dbg
alexfertel May 27, 2024
8946d04
dbg
alexfertel May 27, 2024
7fe83cb
dbg
alexfertel May 27, 2024
9aede70
dbg
alexfertel May 27, 2024
7b5dcc8
dbg
alexfertel May 27, 2024
76233e9
dbg
alexfertel May 27, 2024
7c2e692
dbg
alexfertel May 27, 2024
c9b48c4
dbg
alexfertel May 27, 2024
ad8a42a
fix: add proper support for deploying to nitro-testnode
alexfertel May 28, 2024
20c2a0b
fix: stop deploying contracts before tests run
alexfertel May 28, 2024
5efefde
Merge branch 'main' into constructors
alexfertel May 28, 2024
1b40e5f
ref: migrate to using alloy
alexfertel May 29, 2024
6ea618c
lint(fmt): fix formatting
alexfertel May 29, 2024
365a4b0
fix(e2e): set env variables properly
alexfertel May 29, 2024
769fdc0
fix(e2e): clone nitro testnode in workspace root
alexfertel May 29, 2024
9cb8b46
fix(e2e): clone nitro testnode in workspace root
alexfertel May 29, 2024
d13a310
dbg
alexfertel May 29, 2024
db48dc0
fix(e2e): properly format fund address
alexfertel May 29, 2024
cb93510
ref: trim down erc721 example so that it's deployable on stable
alexfertel May 29, 2024
39239c2
Revert "ref: trim down erc721 example so that it's deployable on stable"
alexfertel May 29, 2024
39eb27a
fix: use nightly to fit contract size limit
alexfertel May 29, 2024
f3a0494
dbg
alexfertel May 29, 2024
ea26710
fix: activate only once
alexfertel May 29, 2024
b401e79
Update lib/e2e/src/deploy.rs
qalisander May 29, 2024
9747760
fix: actually send txs to the network in tests
alexfertel May 29, 2024
7edf5f6
fix: skip running unit tests on e2e ci
alexfertel May 29, 2024
98c19a0
Merge branch 'constructors' of https://github.com/OpenZeppelin/rust-c…
alexfertel May 29, 2024
cf6e716
ref: extract abi from example tests
alexfertel May 29, 2024
4eed895
lint(fmt): fix formatting
alexfertel May 29, 2024
ef8474e
fix: expect receiving the receipt instead of just watching txs
alexfertel May 29, 2024
7f9f342
test(erc20): test contract construction onchain
alexfertel May 30, 2024
0fe8ae1
fix(e2e): properly implement alloy error assertions
alexfertel May 31, 2024
733084e
fix(e2e): properly set from field of txs
alexfertel May 31, 2024
bb7d586
ref: remove unnecessary comment
alexfertel May 31, 2024
5b440f3
fix: use parent path in nitro-testnode script
alexfertel May 31, 2024
b9d2bfb
chore: link to GH issue for nitro-testnode work
alexfertel May 31, 2024
0e4bbdc
ref: dedup RPC_URL name locations
alexfertel May 31, 2024
6bdc04a
ref: simplify code a bit
alexfertel May 31, 2024
5b6fd4c
chore: link to GH issue
alexfertel May 31, 2024
b94bfb6
fix: typo in comment
alexfertel May 31, 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
15 changes: 10 additions & 5 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: e2e-tests
#
# It roughly follows these steps:
# - A local `nitro-testnode` gets spun up.
# - The test suite runs
# Test contract deployments and test user funding happen per test.
# - The test suite runs.
#
# Contract deployments and account funding happen on a per-test basis.
permissions:
contents: read
on:
Expand Down Expand Up @@ -52,9 +53,13 @@ jobs:
run: RUSTFLAGS="-C link-args=-rdynamic" cargo install [email protected]

- name: setup nitro node
run: ./e2e-tests/nitro-testnode.sh -d -i

run: ./scripts/nitro-testnode.sh -d -i
- name: install solc
run: |
curl -LO https://github.com/ethereum/solidity/releases/download/v0.8.21/solc-static-linux
sudo mv solc-static-linux /usr/bin/solc
sudo chmod a+x /usr/bin/solc
- name: run integration tests
run: |
export NIGHTLY_TOOLCHAIN=${{steps.toolchain.outputs.name}}
./e2e-tests/test.sh
./scripts/e2e-tests.sh
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
run: cargo generate-lockfile
# https://twitter.com/jonhoo/status/1571290371124260865
- name: cargo test --locked
run: cargo test --locked --all-features --all-targets
run: cargo test --locked --features std --all-targets
# https://github.com/rust-lang/cargo/issues/6669
- name: cargo test --doc
run: cargo test --locked --all-features --doc
run: cargo test --locked --features std --doc
os-check:
# Run cargo test on MacOS and Windows.
runs-on: ${{ matrix.os }}
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
run: cargo test --locked --features std --all-targets
coverage:
# Use llvm-cov to build and collect coverage and outputs in a format that
# is compatible with codecov.io.
Expand Down Expand Up @@ -113,7 +113,8 @@ jobs:
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
# FIXME: Include e2e tests in coverage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also are we going to write tests for test framework?

Copy link
Member

@qalisander qalisander May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is fine to have a full test coverage just for contracts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also are we going to write tests for test framework?

We should, but it's low priority.

Copy link
Member

@qalisander qalisander May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that it is as low priority that we shall not think about it right now. Good proof that testing framework working as expected are basically "green" tests that use it.

run: cargo llvm-cov --locked --features std --lcov --output-path lcov.info
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
Expand Down
Loading
Loading