parallelise test execution (#1775)

* parallelise test execution

* Rename tests

* Fix tests
pull/1779/head
Nikhil Parasaram 1 year ago committed by GitHub
parent aac630f5f8
commit 4084113513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      .circleci/config.yml
  2. 6
      Dockerfile
  3. 0
      tests/cli_tests/cli_opts_test.py
  4. 0
      tests/disassembler/asm_test.py
  5. 2
      tests/disassembler/disassembly_test.py
  6. 0
      tests/instructions/basefee_test.py
  7. 2
      tests/instructions/create2_test.py
  8. 0
      tests/integration_tests/safe_functions_test.py
  9. 0
      tests/integration_tests/solc_settings_test.py
  10. 0
      tests/integration_tests/src_mapping_test.py
  11. 0
      tests/laser/Precompiles/blake2_test.py
  12. 0
      tests/laser/Precompiles/ec_add_test.py
  13. 0
      tests/laser/Precompiles/ecrecover_test.py
  14. 0
      tests/laser/Precompiles/elliptic_curves_test.py
  15. 0
      tests/laser/Precompiles/elliptic_mul_test.py
  16. 0
      tests/laser/Precompiles/identity_test.py
  17. 0
      tests/laser/Precompiles/mod_exp_test.py
  18. 0
      tests/laser/Precompiles/ripemd_test.py
  19. 0
      tests/laser/Precompiles/sha256_test.py
  20. 0
      tests/laser/strategy/beam_test.py
  21. 0
      tests/laser/strategy/loop_bound_test.py
  22. 3
      tests/laser/transaction_test.py

@ -12,6 +12,7 @@ jobs:
# Basic testing of a new commit to any branch. # Basic testing of a new commit to any branch.
test: test:
<<: *defaults <<: *defaults
parallelism: 4
steps: steps:
- checkout: - checkout:
path: /home/mythril path: /home/mythril
@ -50,7 +51,9 @@ jobs:
- run: - run:
name: Unit-testing name: Unit-testing
command: tox command: |
TESTFILES=$(circleci tests glob tests/**/*test.py | circleci tests split --split-by=timings)
tox -- $TESTFILES
working_directory: /home/mythril working_directory: /home/mythril
no_output_timeout: 10m no_output_timeout: 10m
environment: environment:

@ -123,9 +123,9 @@ print("\n".join(str(v) for v in solcx.get_installed_solc_versions()))
# Check myth can run # Check myth can run
myth version myth version
myth function-to-hash 'function transfer(address _to, uint256 _value) public returns (bool success)' myth function-to-hash 'function transfer(address _to, uint256 _value) public returns (bool success)'
myth analyze /solidity_examples/timelock.sol > timelock.log || true myth analyze /solidity_examples/origin.sol -t 1 > origin.log || true
grep 'SWC ID: 116' timelock.log || { grep 'SWC ID: 115' origin.log || {
error "Failed to detect SWC ID: 116 in timelock.sol"; error "Failed to detect SWC ID: 115 in origin.sol";
exit 1 exit 1
} }

@ -41,7 +41,7 @@ def test_get_function_info_multiple_names(mocker):
) )
# Assert # Assert
assert function_name == "**ambiguous** function_name" assert function_name == "function_name or another_name"
def test_get_function_info_no_names(mocker): def test_get_function_info_no_names(mocker):

@ -4,6 +4,7 @@ from mythril.laser.ethereum.state.environment import Environment
from mythril.laser.ethereum.state.machine_state import MachineState from mythril.laser.ethereum.state.machine_state import MachineState
from mythril.laser.ethereum.state.global_state import GlobalState from mythril.laser.ethereum.state.global_state import GlobalState
from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum.state.world_state import WorldState
from mythril.laser.ethereum.time_handler import time_handler
from mythril.laser.ethereum.instructions import Instruction from mythril.laser.ethereum.instructions import Instruction
from mythril.laser.ethereum.transaction.transaction_models import ( from mythril.laser.ethereum.transaction.transaction_models import (
MessageCallTransaction, MessageCallTransaction,
@ -57,6 +58,7 @@ def test_create2():
] ]
og_state.mstate.memory.extend(100) og_state.mstate.memory.extend(100)
og_state.mstate.memory[0:6] = [96] * 6 og_state.mstate.memory[0:6] = [96] * 6
time_handler.start_execution(10)
instruction = Instruction("create2", dynamic_loader=None) instruction = Instruction("create2", dynamic_loader=None)
# Act + Assert # Act + Assert
with pytest.raises(TransactionStartSignal) as t: with pytest.raises(TransactionStartSignal) as t:

@ -2,6 +2,7 @@ from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum import svm from mythril.laser.ethereum import svm
from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.account import Account
from mythril.laser.ethereum.state.world_state import WorldState from mythril.laser.ethereum.state.world_state import WorldState
from mythril.support.support_args import args
import mythril.laser.ethereum.cfg as cfg import mythril.laser.ethereum.cfg as cfg
@ -24,7 +25,7 @@ def test_intercontract_call():
callee_account = Account(callee_address, callee_code, contract_name="Callee") callee_account = Account(callee_address, callee_code, contract_name="Callee")
world_state.put_account(callee_account) world_state.put_account(callee_account)
world_state.put_account(caller_account) world_state.put_account(caller_account)
args.pruning_factor = 1
laser = svm.LaserEVM() laser = svm.LaserEVM()
# Act # Act
Loading…
Cancel
Save