Skip to content

Commit

Permalink
Use nose to run tests on travis in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzb committed Aug 29, 2018
1 parent f65ec95 commit ba25678
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ before_install:
script:
- ls
- pwd
- docker run -v $PWD:/repo lorenzb/proveth bash -c "cp -r /repo /repo2 && cd /repo2/ && python3.6 -m pip install -r requirements.txt && python3.6 onchain/test/test_ProvethVerifier.py"

- docker run -v $PWD:/repo lorenzb/proveth bash -c "cp -r /repo /repo2 && cd /repo2/ && python3.6 -m pip install -r requirements.txt nose && python3.6 -m nose --verbose --processes=4 --process-timeout=360 --testmatch='^test_' onchain/test/test_ProvethVerifier.py"
24 changes: 13 additions & 11 deletions onchain/test/test_ProvethVerifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import proveth

class TestVerifier(unittest.TestCase):
# Allow nose testrunner to run the various tests in this file in parallel
# This is ignored by the regular unittest module
_multiprocess_can_split_ = True

def null_address(self):
return '0x' + '0' * 40

Expand Down Expand Up @@ -254,19 +258,17 @@ def help_test_entire_block(self, path_to_jsonrpc_response):
if i > 0 and i % 100 == 0:
self.chain.mine()

def test_mainnet_block_1(self):
self.help_test_entire_block('resources/0x0b963d785005ee2d25cb078daba5dd5cae1b376707ac53533d8ad638f9cb9659.json')

def test_mainnet_blocks(self):
blocks = [
'0x0b963d785005ee2d25cb078daba5dd5cae1b376707ac53533d8ad638f9cb9659.json',
'0x23d2df699671ac564b382f5b046e0cf533ebc44ab8e36426cef9d60486c3a220.json',
'0x2471ea6da13bb9926a988580fae95056ef1610291d3628aca0ef7f91456c9ef4.json',
'0x829bb7e1211b1f6f85b9944c2ba1a1614a7d7dedebe9e6bd530ca93dae126a16.json',
]
for block in blocks:
with self.subTest(block=block):
print(block)
self.help_test_entire_block(os.path.join('resources', block))
def test_mainnet_block_2(self):
self.help_test_entire_block('resources/0x23d2df699671ac564b382f5b046e0cf533ebc44ab8e36426cef9d60486c3a220.json')

def test_mainnet_block_3(self):
self.help_test_entire_block('resources/0x2471ea6da13bb9926a988580fae95056ef1610291d3628aca0ef7f91456c9ef4.json')

def test_mainnet_block_4(self):
self.help_test_entire_block('resources/0x829bb7e1211b1f6f85b9944c2ba1a1614a7d7dedebe9e6bd530ca93dae126a16.json')

def test_single_short_transaction(self):
self.help_test_entire_block('resources/block_with_single_short_transaction.json')
Expand Down

0 comments on commit ba25678

Please sign in to comment.