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

test: more regression tests + external tests #121

Merged
merged 31 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0e3f7bf
switch to pytest for regression testing
daejunpark Jul 15, 2023
ab799d2
fix ci
daejunpark Jul 17, 2023
18b1ec6
fix expected
daejunpark Jul 17, 2023
475eaae
address comments
daejunpark Jul 18, 2023
fd678a1
remove time info from expected json
daejunpark Jul 18, 2023
14e1619
add comments
daejunpark Jul 18, 2023
0b87818
fix lint error
daejunpark Jul 18, 2023
0f36729
add examples in the pytest
daejunpark Jul 18, 2023
c65f3f2
add proxy test
daejunpark Jul 18, 2023
c302e75
add submodule openzeppelin-contracts
daejunpark Jul 18, 2023
58c4643
update expected
daejunpark Jul 18, 2023
a59a9a5
add submodule halmos-cheatcodes
daejunpark Jul 18, 2023
5d47f02
update tests
daejunpark Jul 18, 2023
06f1dee
update forge-std submodule
daejunpark Jul 18, 2023
56d7516
fix lint error
daejunpark Jul 18, 2023
901d96c
add reset test
daejunpark Jul 18, 2023
4e6937f
add own reset test
daejunpark Jul 18, 2023
284f310
add pytest -v -s options
daejunpark Jul 18, 2023
a36e7c5
add halmos -v -st options
daejunpark Jul 18, 2023
67ba4d4
add external repo tests
daejunpark Jul 18, 2023
4aafa7e
parameterize external tests workflow
daejunpark Jul 18, 2023
331ce86
add cicada external tests
daejunpark Jul 18, 2023
9e32f1c
update external test ci
daejunpark Jul 18, 2023
eb94329
increase timeout
daejunpark Jul 18, 2023
4fc00fb
improve json parsing fail handler
daejunpark Jul 18, 2023
308b5a2
add farcaster tests
daejunpark Jul 18, 2023
e771713
update ci
daejunpark Jul 18, 2023
521e3c0
Merge branch 'main' into feat/pytest
daejunpark Jul 18, 2023
fadf77c
try running external tests in macos
daejunpark Jul 18, 2023
1ef16c1
ci: increase timeout
daejunpark Jul 18, 2023
a2ac789
ci: increase timeout
daejunpark Jul 18, 2023
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
64 changes: 64 additions & 0 deletions .github/workflows/test-external.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test external projects

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: macos-latest

strategy:
matrix:
include:
- repo: "morpho-org/morpho-data-structures"
dir: "morpho-data-structures"
cmd: "halmos --function testProve --loop 4 --symbolic-storage --test-parallel --solver-parallel --solver-timeout-assertion 60000"
branch: ""
- repo: "a16z/cicada"
dir: "cicada"
cmd: "halmos -v -st --contract LibUint1024Test --function testProve --loop 256 --test-parallel --solver-parallel --solver-timeout-assertion 1000000"
branch: "test/halmos"
- repo: "a16z/cicada"
dir: "cicada"
cmd: "halmos -v -st --contract LibPrimeTest --function testProve --loop 256 --test-parallel"
branch: "test/halmos"
- repo: "farcasterxyz/contracts"
dir: "farcaster-contracts"
cmd: "halmos -v -st --test-parallel --solver-parallel --solver-timeout-assertion 60000"
branch: "test/halmos"

steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: halmos
submodules: recursive

- name: Checkout external repo
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
path: ${{ matrix.dir }}
ref: ${{ matrix.branch }}
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: python -m pip install --upgrade pip

- name: Install Halmos
run: python -m pip install -e ./halmos

- name: Test external repo
run: ${{ matrix.cmd }}
working-directory: ${{ matrix.dir }}
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
matrix:
os: ["ubuntu-latest", "windows-2022"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.8.13", "3.9.13", "3.10.6"]
parallel: ["", "--test-parallel", "--solver-parallel", "--test-parallel --solver-parallel"]
exclude:
# python 3.8.13 is not available in windows-2022
- os: "windows-2022"
Expand Down Expand Up @@ -42,7 +41,4 @@ jobs:
run: pip install -e .

- name: Run pytest
run: pytest

- name: Test Halmos
run: halmos --root tests --symbolic-storage --function test ${{ matrix.parallel }}
run: pytest -v -s
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "tests/lib/forge-std"]
path = tests/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "tests/lib/openzeppelin-contracts"]
path = tests/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts.git
[submodule "tests/lib/halmos-cheatcodes"]
path = tests/lib/halmos-cheatcodes
url = https://github.com/a16z/halmos-cheatcodes
Loading