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/simplify tests #39

Merged
merged 31 commits into from
Feb 13, 2024
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
c91d58f
Remove command line arguments
DanielSchiavini Jan 11, 2024
8cd984a
Merge CI scripts
DanielSchiavini Jan 11, 2024
7037289
Add secret, naming
DanielSchiavini Jan 11, 2024
9fe7f96
Split factory tests
DanielSchiavini Jan 11, 2024
da9026b
Get rid of autouse markers that use swap
DanielSchiavini Jan 12, 2024
729847e
Parametrization should happen on function level
DanielSchiavini Jan 12, 2024
f402cea
Split token tests
DanielSchiavini Jan 12, 2024
35571d2
More fixtures in function scope
DanielSchiavini Jan 12, 2024
f2cbfc2
Deployers in session scope + fixture fixes
DanielSchiavini Jan 15, 2024
33e4ba9
Updated linting
DanielSchiavini Jan 15, 2024
06aa427
Module for contract loading
DanielSchiavini Jan 15, 2024
3c72fbb
Less test cases
DanielSchiavini Jan 16, 2024
eb344cd
Determinism
DanielSchiavini Jan 16, 2024
c5712e0
Fix difference basic vs plain
DanielSchiavini Jan 17, 2024
56510d8
Split pool tests
DanielSchiavini Jan 17, 2024
032c578
Split liquidity tests
DanielSchiavini Jan 19, 2024
bc5c37a
Only run fixtures when used
DanielSchiavini Jan 19, 2024
d61b1b6
Debugging ¯\_(ツ)_/¯
DanielSchiavini Jan 19, 2024
0a54354
More fixture unscrambling
DanielSchiavini Jan 22, 2024
ab7de7b
Separate fixtures for meta
DanielSchiavini Jan 22, 2024
9e39e58
Reset env between tests
DanielSchiavini Jan 22, 2024
3ab3e37
Try to run with custom vyper version
DanielSchiavini Jan 23, 2024
10fa206
Disable fast mode, clear env contracts
DanielSchiavini Jan 29, 2024
7c815bc
Fixture fixes
DanielSchiavini Jan 31, 2024
6c671f0
Revert to vyper 0.3.10
DanielSchiavini Jan 31, 2024
3af752e
Convert marker to fixture
DanielSchiavini Jan 31, 2024
ddbbc9a
No init for test directories
DanielSchiavini Jan 31, 2024
60a81f1
Document markers
DanielSchiavini Feb 2, 2024
42fec1b
Revert script formatting
DanielSchiavini Feb 2, 2024
f507773
add meta ng zap
bout3fiddy Feb 13, 2024
f70a77a
add tests for remove one coin
bout3fiddy Feb 13, 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
49 changes: 0 additions & 49 deletions .github/tentative_workflows/test_factory.yaml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/tentative_workflows/test_gauge.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/tentative_workflows/test_pools_2.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/tentative_workflows/test_token.yaml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on: [push]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python 3.10.4
uses: actions/setup-python@v4
with:
python-version: 3.10.4

- uses: pre-commit/[email protected]

tests:
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
name:
- gauge
- pools/exchange
- pools/general
- pools/liquidity
- pools/meta
- pools/oracle
- factory

steps:
- uses: actions/checkout@v3

- name: Cache Compiler Installations
uses: actions/cache@v3
with:
path: ~/.vvm
key: compiler-cache

- name: Setup Python 3.10.4
uses: actions/setup-python@v4
with:
python-version: 3.10.4

- name: Install Requirements
run: |
pip install poetry==1.5.1
poetry config virtualenvs.in-project true
poetry install --no-interaction --without dev

- name: Run Tests
env:
WEB3_PROVIDER_URL: ${{ secrets.WEB3_PROVIDER_URL }}
run: |
source .venv/bin/activate
pytest --numprocesses=auto tests/${{ matrix.name }}/
18 changes: 0 additions & 18 deletions .github/workflows/lint.yaml

This file was deleted.

24 changes: 13 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 22.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.0
hooks:
- id: black
args: [--line-length=120]
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
args:
- --skip-magic-trailing-comma
- --target-version=py310
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--max-line-length=120]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", --line-length=120]
# profile and line-length to avoid clashes with black
args: ["--profile=black", "--line-length=88"]

default_language_version:
python: python3.10.4
python: python3.10
14 changes: 3 additions & 11 deletions README.MD → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For a full list of deployments, please check: [The deployment script](scripts/de
The metapool factory has several core components:

- [`Factory`](contracts/main/CurveStableSwapFactoryNG.vy) is the main contract used to deploy new metapools. It also acts a registry for finding the deployed pools and querying information about them.
- New pools are deployed via blueprints. The [implementation contract](contracts/main/CurveStableSwapNG.vy) targetted by the proxy is determined according to the base pool.
- New pools are deployed via blueprints. The [implementation contract](contracts/main/CurveStableSwapNG.vy) targeted by the proxy is determined according to the base pool.

See the [documentation](https://docs.curve.fi) for more detailed information.

Expand All @@ -28,14 +28,6 @@ pip install poetry==1.5.1
poetry install
```

### Paramaters

- `--pool-size` - size of pool (N_COINS), available parameters: `[2]`
- `--pool-type` - type of pool, available parameters: `[basic,meta]`
- `--token-types` - token types to test against(divided by comma), available parameters: `[plain,eth,oracle,rebasing]`
- `--decimals` - token decimals (divided by comma), default `18,18`
- `--return-types` - types of .transfer() returns to test against (divided by comma), default `revert,False,None`

### Type of tests

Testing gauge
Expand All @@ -47,13 +39,13 @@ pytest tests/gauge/
Testing factory

```shell
pytest tests/test_factory.py
pytest tests/factory/
```

Testing swap is ERC20

```shell
pytest tests/test_token.py
pytest tests/token/
```

Testing swaps
Expand Down
Loading
Loading