Skip to content

Commit

Permalink
Merge pull request #39 from curvefi/feat/simplify_tests
Browse files Browse the repository at this point in the history
simplifies tests (still needs some more work)
  • Loading branch information
bout3fiddy committed Feb 13, 2024
2 parents 17cba9d + f70a77a commit 9c2b488
Show file tree
Hide file tree
Showing 81 changed files with 4,173 additions and 3,989 deletions.
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/action@v3.0.0

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

0 comments on commit 9c2b488

Please sign in to comment.