Skip to content

Commit

Permalink
Merge pull request #135 from DanielSchiavini/coverage
Browse files Browse the repository at this point in the history
chore: add coverage check
  • Loading branch information
charles-cooper authored Feb 14, 2024
2 parents 786e44f + f77e5ca commit 6117f96
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: unitary

on: ["push", "pull_request"]
on: [ "push", "pull_request" ]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: [ "3.10", "3.11" ]

name: "unit tests: python ${{ matrix.python-version }}"

Expand All @@ -29,7 +29,20 @@ jobs:
pip install .
- name: Run Unit Tests
run: pytest -n auto tests/unitary/
env:
PYTHONPATH: ${{ github.workspace }}
# pass internals to pytest-cov, since we are testing a pytest plugin.
# See https://github.com/pytest-dev/pytest-cov/blob/2c9f2170/docs/plugins.rst
COV_CORE_SOURCE: boa
COV_CORE_CONFIG: .coveragerc
COV_CORE_DATAFILE: .coverage.eager
run: >-
pytest
--cov=boa
--cov-append
--cov-report term-missing:skip-covered
--cov-fail-under=70
tests/unitary/
integration:
name: "integration tests (forked and networked modes)"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ venv/
*.env

.coverage
.coverage.*
2 changes: 1 addition & 1 deletion boa/integrations/jupyter/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from os.path import dirname, join, realpath

import requests
from IPython.core.display import Javascript, display
from IPython.display import Javascript, display

from boa.integrations.jupyter.constants import ETHERS_JS_URL

Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ mypy
pre-commit
pytest
pytest-xdist
pytest-cov
sphinx-rtd-theme
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies = [
"eth-typing",
"hypothesis",
"pytest",
"pytest-cov",
"rich",

# required for forking:
Expand All @@ -41,7 +42,11 @@ requires = ["setuptools", "wheel"]
include = ["boa*"]

[tool.pytest.ini_options]
markers = ["ignore_isolation: Do not preserve state during tests"]
markers = [
"ignore_isolation: Do not preserve state during tests",
"gas_profile: Enable gas profiling.",
"ignore_profiling: Disable gas profiling.",
]

[tool.setuptools.package-data]
boa = ["integrations/**/*.js"]
Expand Down
2 changes: 1 addition & 1 deletion tests/unitary/stateful/test_state_machine_isolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def test_state_machine_isolation(boa_contract):
StateMachine.contract = boa_contract
StateMachine.settings = {
"stateful_step_count": NUM_STEPS,
"suppress_health_check": HealthCheck.all(),
"suppress_health_check": list(HealthCheck),
}
run_state_machine_as_test(StateMachine)

0 comments on commit 6117f96

Please sign in to comment.