Skip to content

Commit

Permalink
re-enable some tests on Win64 since Nim 1.0.2 fixes nim-lang/Nim#12186 (
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored and mratsim committed Nov 1, 2019
1 parent 753d5af commit 55dac3e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 47 deletions.
7 changes: 0 additions & 7 deletions tests/official/fixtures_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,3 @@ proc parseTest*(path: string, Format: typedesc[Json or SSZ], T: typedesc): T =
stderr.write $Format & " load issue for file \"", path, "\"\n"
stderr.write err.formatMsg(path), "\n"
quit 1

template skipWin64*(body: untyped): untyped =
# Skip Win64 CI for https://github.com/status-im/nim-beacon-chain/issues/435
when defined(windows) and sizeof(int) == 8:
echo " [OSError] See #435. Ignoring in Windows 64-bit CI"
else:
body
7 changes: 3 additions & 4 deletions tests/official/test_fixture_bls.nim
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ const BLSDir = JsonTestsDir/"general"/"phase0"/"bls"
suite "Official - BLS tests":
test "Private to public key conversion":
for file in walkDirRec(BLSDir/"priv_to_pub"):
skipWin64:
let t = parseTest(file, Json, BLSPrivToPub)
let implResult = t.input.pubkey()
check: implResult == t.output
let t = parseTest(file, Json, BLSPrivToPub)
let implResult = t.input.pubkey()
check: implResult == t.output

test "Message signing":
for file in walkDirRec(BLSDir/"sign_msg"):
Expand Down
29 changes: 13 additions & 16 deletions tests/official/test_fixture_operations_deposits.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,17 @@ template runTest(testName: string, identifier: untyped) =
`testImpl _ operations_deposits _ identifier`()

suite "Official - Operations - Deposits " & preset():
# TODO https://github.com/status-im/nim-beacon-chain/issues/435
# CI Win64 - "The parameter is incorrect"
skipWin64:
runTest("new deposit under max", new_deposit_under_max)
runTest("new deposit max", new_deposit_max)
runTest("new deposit over max", new_deposit_over_max)
runTest("invalid signature new deposit", invalid_sig_new_deposit)
runTest("success top-up", success_top_up)
runTest("invalid signature top-up", invalid_sig_top_up)
runTest("invalid withdrawal credentials top-up", invalid_withdrawal_credentials_top_up)
runTest("new deposit under max", new_deposit_under_max)
runTest("new deposit max", new_deposit_max)
runTest("new deposit over max", new_deposit_over_max)
runTest("invalid signature new deposit", invalid_sig_new_deposit)
runTest("success top-up", success_top_up)
runTest("invalid signature top-up", invalid_sig_top_up)
runTest("invalid withdrawal credentials top-up", invalid_withdrawal_credentials_top_up)

when false:
# TODO - those should give an exception but do not
# probably because skipValidation is too strong
# https://github.com/status-im/nim-beacon-chain/issues/407
runTest("wrong deposit for deposit count", wrong_deposit_for_deposit_count)
runTest("bad merkle proof", bad_merkle_proof)
when false:
# TODO - those should give an exception but do not
# probably because skipValidation is too strong
# https://github.com/status-im/nim-beacon-chain/issues/407
runTest("wrong deposit for deposit count", wrong_deposit_for_deposit_count)
runTest("bad merkle proof", bad_merkle_proof)
23 changes: 10 additions & 13 deletions tests/official/test_fixture_operations_proposer_slashings.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,13 @@ template runTest(identifier: untyped) =
`testImpl_proposer_slashing _ identifier`()

suite "Official - Operations - Proposer slashing " & preset():
# TODO https://github.com/status-im/nim-beacon-chain/issues/435
# CI Win64 - "The parameter is incorrect"
skipWin64:
runTest(success)
runTest(invalid_sig_1)
runTest(invalid_sig_2)
runTest(invalid_sig_1_and_2)
runTest(invalid_proposer_index)
runTest(epochs_are_different)
runTest(headers_are_same)
runTest(proposer_is_not_activated)
runTest(proposer_is_slashed)
runTest(proposer_is_withdrawn)
runTest(success)
runTest(invalid_sig_1)
runTest(invalid_sig_2)
runTest(invalid_sig_1_and_2)
runTest(invalid_proposer_index)
runTest(epochs_are_different)
runTest(headers_are_same)
runTest(proposer_is_not_activated)
runTest(proposer_is_slashed)
runTest(proposer_is_withdrawn)
3 changes: 1 addition & 2 deletions tests/official/test_fixture_operations_voluntary_exit.nim
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ template runTest(identifier: untyped) =
`testImpl _ voluntary_exit _ identifier`()

suite "Official - Operations - Voluntary exit " & preset():
skipWin64:
runTest(success)
runTest(success)
runTest(invalid_signature)
runTest(success_exit_queue)
runTest(validator_exit_in_future)
Expand Down
8 changes: 3 additions & 5 deletions tests/official/test_fixture_sanity_blocks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ suite "Official - Sanity - Blocks " & preset():
runValidTest("Skipped Slots", skipped_slots, 1)
runValidTest("Empty epoch transition", empty_epoch_transition, 1)
when const_preset=="minimal":
skipWin64:
runValidTest("Empty epoch transition not finalizing", empty_epoch_transition_not_finalizing, 1)
runValidTest("Empty epoch transition not finalizing", empty_epoch_transition_not_finalizing, 1)
runValidTest("Proposer slashing", proposer_slashing, 1)
runValidTest("Attester slashing", attester_slashing, 1)

Expand All @@ -99,6 +98,5 @@ suite "Official - Sanity - Blocks " & preset():
runValidTest("Balance-driven status transitions", balance_driven_status_transitions, 1)
runValidTest("Historical batch", historical_batch, 1)
when const_preset=="minimal":
skipWin64:
runValidTest("ETH1 data votes consensus", eth1_data_votes_consensus, 17)
runValidTest("ETH1 data votes no consensus", eth1_data_votes_no_consensus, 16)
runValidTest("ETH1 data votes consensus", eth1_data_votes_consensus, 17)
runValidTest("ETH1 data votes no consensus", eth1_data_votes_no_consensus, 16)

0 comments on commit 55dac3e

Please sign in to comment.