From 22adccc9170cd5e522f80c0d3962acf94f251a47 Mon Sep 17 00:00:00 2001 From: Mamy Ratsimbazafy Date: Sun, 24 Nov 2019 11:46:45 +0100 Subject: [PATCH] support List in reportDiff and comment out BLS and shuffling tests (#585) * support List in report diff * Json tests were removed but walkDirRec lull-ed us into thinking we were passing them :/ --- tests/all_tests.nim | 10 ++++++---- tests/helpers/debug_state.nim | 2 +- tests/official/fixtures_utils.nim | 1 - tests/official/test_fixture_bls.nim | 1 + tests/official/test_fixture_shuffling.nim | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/all_tests.nim b/tests/all_tests.nim index 65b76b9c0..1ce23f735 100644 --- a/tests/all_tests.nim +++ b/tests/all_tests.nim @@ -30,7 +30,9 @@ import # Refactor state transition unit tests ./spec_block_processing/test_process_attestation, ./spec_epoch_processing/test_process_justification_and_finalization -import # Official fixtures that don't require SSZ parsing of invalid BLS signatures - # https://github.com/status-im/nim-beacon-chain/issues/374 - ./official/test_fixture_shuffling, - ./official/test_fixture_bls +# TODO: json tests were removed + +# import # Official fixtures that don't require SSZ parsing of invalid BLS signatures +# # https://github.com/status-im/nim-beacon-chain/issues/374 +# ./official/test_fixture_shuffling, +# ./official/test_fixture_bls diff --git a/tests/helpers/debug_state.nim b/tests/helpers/debug_state.nim index 7f15e7d13..f6f8064d9 100644 --- a/tests/helpers/debug_state.nim +++ b/tests/helpers/debug_state.nim @@ -92,7 +92,7 @@ proc inspectType(tImpl, xSubField, ySubField: NimNode, stmts: var NimNode) = inspectType(tImpl[0], xSubField, ySubField, stmts) of {nnkSym, nnkBracketExpr}: if tImpl.kind == nnkBracketExpr: - assert tImpl[0].eqIdent"seq" or tImpl[0].eqIdent"array", "Error: unsupported generic type: " & $tImpl[0] + assert tImpl[0].eqIdent"List" or tImpl[0].eqIdent"seq" or tImpl[0].eqIdent"array", "Error: unsupported generic type: " & $tImpl[0] compareContainerStmt(xSubField, ySubField, stmts) elif $tImpl in builtinTypes: compareStmt(xSubField, ySubField, stmts) diff --git a/tests/official/fixtures_utils.nim b/tests/official/fixtures_utils.nim index f93df928e..83a76b6c7 100644 --- a/tests/official/fixtures_utils.nim +++ b/tests/official/fixtures_utils.nim @@ -36,7 +36,6 @@ proc readValue*(r: var JsonReader, a: var seq[byte]) {.inline.} = const FixturesDir* = currentSourcePath.rsplit(DirSep, 1)[0] / "fixtures" - JsonTestsDir* = FixturesDir/"json_tests_v0.8.3" SszTestsDir* = FixturesDir/"tests-v0.9.2" proc parseTest*(path: string, Format: typedesc[Json or SSZ], T: typedesc): T = diff --git a/tests/official/test_fixture_bls.nim b/tests/official/test_fixture_bls.nim index 112dc4129..18d1bfb72 100644 --- a/tests/official/test_fixture_bls.nim +++ b/tests/official/test_fixture_bls.nim @@ -46,6 +46,7 @@ proc readValue*(r: var JsonReader, a: var Domain) {.inline.} = # (0.20) a = hexToPaddedByteArray[8](r.readValue(string)) +# TODO: json tests were removed const BLSDir = JsonTestsDir/"general"/"phase0"/"bls" suite "Official - BLS tests": diff --git a/tests/official/test_fixture_shuffling.nim b/tests/official/test_fixture_shuffling.nim index 39e8ba7c2..7340945ee 100644 --- a/tests/official/test_fixture_shuffling.nim +++ b/tests/official/test_fixture_shuffling.nim @@ -22,6 +22,7 @@ type count*: uint64 mapping*: seq[uint64] +# TODO: json tests were removed const ShufflingDir = JsonTestsDir/const_preset/"phase0"/"shuffling"/"core"/"shuffle" suite "Official - Shuffling tests [Preset: " & preset():