Fixes failing test and python version

pull/242/head
Josh Asplund 7 years ago
parent d632798abb
commit 11a2bb7430
  1. 35
      .circleci/config.yml
  2. 3
      .coveragerc
  3. 9
      tests/analysis/test_delegatecall.py
  4. 23
      tox.ini

@ -15,13 +15,22 @@ jobs:
# path param in checkout command, and this symlink compenstates for that.
# - run: ln -s /root/project /home/mythril
- restore-cache:
keys:
- tox-env-{{ checksum "/home/mythril/tox.ini" }}-{{ checksum "/home/mythril/setup.py" }}
- run:
name: Installing mythril tools
command: cd /home && ./install-mythril-tools.sh laser-ethereum
command: ./install-mythril-tools.sh laser-ethereum
working_directory: /home
- run:
name: Install dependencies, in case any are missing in Docker image
command: pip3 install -r /home/mythril/requirements.txt
name: Install tox envs
command: tox -vv --notest
working_directory: /home/mythril
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
- run:
background: true
@ -30,7 +39,8 @@ jobs:
- run:
name: Unit-testing
command: cd /home/mythril && tox
command: tox
working_directory: /home/mythril
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
@ -41,9 +51,15 @@ jobs:
- store_artifacts:
path: /home/mythril/.tox/output
- save_cache:
key: tox-env-{{ checksum "/home/mythril/tox.ini" }}-{{ checksum "/home/mythril/setup.py" }}
paths:
- .tox/py*
- run:
name: Ensuring that setup script is functional
command: cd /home/mythril && python3 setup.py install
command: python3 setup.py install
working_directory: /home/mythril
- run:
name: Integration tests
@ -56,13 +72,16 @@ jobs:
path: /home/mythril
- run:
name: Verify Git tag vs. version
command: cd /home/mythril && python3 setup.py verify
command: python3 setup.py verify
working_directory: /home/mythril
- run:
name: Build
command: cd /home/mythril && python3 setup.py sdist
command: python3 setup.py sdist
working_directory: /home/mythril
- run:
name: Deploy
command: cd /home/mythril && twine upload dist/*
command: twine upload dist/*
working_directory: /home/mythril
workflows:
version: 2

@ -8,6 +8,3 @@ omit =
/usr/*
*_test.py
setup.py
[html]
directory = coverage_html_report

@ -3,8 +3,7 @@ from mythril.analysis.ops import Call, Variable, VarType
from mythril.analysis.symbolic import SymExecWrapper
from laser.ethereum.svm import GlobalState, Node, Environment, Account
import pytest
import mock
from mock import patch
from unittest.mock import MagicMock, patch
import pytest_mock
@ -185,7 +184,7 @@ def test_delegate_call(sym_mock, concrete_mock, curr_instruction):
to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, state, None, "DELEGATECALL", to, None)
statespace = mock.MagicMock()
statespace = MagicMock()
statespace.calls = [call]
# act
@ -211,7 +210,7 @@ def test_delegate_call_not_delegate(sym_mock, concrete_mock):
to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, None, None, "NOT_DELEGATECALL", to, None)
statespace = mock.MagicMock()
statespace = MagicMock()
statespace.calls = [call]
# act
@ -238,7 +237,7 @@ def test_delegate_call_not_fallback(sym_mock, concrete_mock):
to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, None, None, "DELEGATECALL", to, None)
statespace = mock.MagicMock()
statespace = MagicMock()
statespace.calls = [call]
# act

@ -1,10 +1,27 @@
[tox]
envlist = py34,py35,py36
envlist = py35,py36
[testenv]
deps=pipenv
whitelist_externals = mkdir
commands=
pipenv install --dev --ignore-pipfile
mkdir -p {toxworkdir}/log/{envname}
pipenv run py.test --junitxml={toxworkdir}/output/pytest/junit-{envname}.xml {posargs}
mkdir -p {toxinidir}/tests/testdata/outputs_current/
py.test \
--junitxml={toxworkdir}/output/junit-{envname}.xml \
{posargs}
[testenv:coverage]
setenv =
COVERAGE_FILE = .coveragerc
deps = pytest-cov
whitelist_externals = mkdir
commands=
pipenv install --dev --ignore-pipfile
mkdir -p {toxinidir}/tests/testdata/outputs_current/
py.test \
--cov=mythril \
--cov-report=xml:{toxworkdir}/output/cov-{envname}.xml \
--cov-report=html:{toxworkdir}/output/cov-{envname}.html \
--junitxml={toxworkdir}/output/junit-{envname}.xml \
{posargs}

Loading…
Cancel
Save