Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
[submodule "ethcore/res/wasm-tests"]
path = ethcore/res/wasm-tests
url = https://github.com/paritytech/wasm-tests
[submodule "test/parity-import-tests"]
path = test/parity-import-tests
url = https://github.com/paritytech/parity-import-tests
25 changes: 19 additions & 6 deletions scripts/aura-test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#!/bin/bash
cargo build -j $(nproc) --release --features final $CARGOFLAGS
git clone https://github.com/paritytech/parity-import-tests
cp target/release/parity parity-import-tests/aura/parity
cd parity-import-tests/aura
rm -rf /tmp/aura-test-data
cargo build -j $(nproc) --release
target/release/parity -v
echo "Start Aura test"
parity import blocks.rlp --chain chain.json
parity restore snap --chain chain.json
target/release/parity import test/parity-import-tests/aura/blocks.rlp --chain test/parity-import-tests/aura/chain.json -d /tmp/aura-test-data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@General-Beck there are now multiple import tests. Can you rewrite this as a loop to be future-proof?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rphmeier What condition can be taken for a loop?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pseudocode like this

for test in parity-import-tests/*
  cd parity-import-tests/$test
  parity --chain chain.json -d /tmp/import-tests import blocks.rlp
  parity --chain chain.json -d /tmp/import-tests restore snap
  cd ../..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each directory has 3 files:

  • chain.json
  • blocks.rlp
  • snap

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rphmeier Will there be a given amount of tests?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, there is no cap. we will add them periodically, whenever necessary.

if [ $? -eq 0 ]
then
echo "Import test passed"
else
echo "Import test failed" >&2
exit 1
fi
target/release/parity restore test/parity-import-tests/aura/snap --chain test/parity-import-tests/aura/chain.json -d /tmp/aura-test-data
if [ $? -eq 0 ]
then
echo "Restore test passed"
else
echo "Restore test failed" >&2
exit 1
fi
echo "Aura test complete"
1 change: 1 addition & 0 deletions test/parity-import-tests
Submodule parity-import-tests added at c5fd38