From 0518095becb7f1a2684eb411160a55753d038871 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Thu, 9 Apr 2020 12:16:23 +0000 Subject: [PATCH] build: Exercise the consim as part of the CI Just so this won't rot, I don't expect this to actually catch anything other than code changes that break consim (or require re-generating the genesis doc used for testing). --- .buildkite/code.pipeline.yml | 18 +++++++++++++ .buildkite/scripts/test_consim.sh | 36 ++++++++++++++++++++++++++ tests/fixture-data/consim/genesis.json | 1 + 3 files changed, 55 insertions(+) create mode 100755 .buildkite/scripts/test_consim.sh create mode 100644 tests/fixture-data/consim/genesis.json diff --git a/.buildkite/code.pipeline.yml b/.buildkite/code.pipeline.yml index 1702877f9a3..7c1cb63e705 100644 --- a/.buildkite/code.pipeline.yml +++ b/.buildkite/code.pipeline.yml @@ -238,6 +238,24 @@ steps: plugins: <<: *docker_plugin_sgx + ############### + # Consensus simulator tests + ############### + - label: Consensus simulator tests + timeout_in_minutes: 3 + command: + - .buildkite/scripts/download_e2e_test_artifacts.sh + - .buildkite/scripts/test_consim.sh + artifact_paths: + - /tmp/consim-datadir/*.json + - /tmp/consim-datadir/consim.log + env: + TEST_BASE_DIR: /tmp + agents: + buildkite_agent_size: large + plugins: + <<: *docker_plugin + #################################### # Rust coverage job (only on master) #################################### diff --git a/.buildkite/scripts/test_consim.sh b/.buildkite/scripts/test_consim.sh new file mode 100755 index 00000000000..1828643c315 --- /dev/null +++ b/.buildkite/scripts/test_consim.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +############################################################ +# This script tests the Oasis Core project with the consensus +# simulator. +# +# Usage: +# test_consim.sh +############################################################ + +# Helpful tips on writing build scripts: +# https://buildkite.com/docs/pipelines/writing-build-scripts +set -euxo pipefail + +# Working directory. +WORKDIR=$PWD + +################# +# Run test suite. +################# + +echo ${WORKDIR} + +# Run the consensusm simulator. +${WORKDIR}/go/oasis-node/oasis-node \ + debug consim \ + --datadir /tmp/consim-datadir \ + --log.level DEBUG \ + --log.file /tmp/consim-datadir/consim.log \ + -g ${WORKDIR}/tests/fixture-data/consim/genesis.json \ + --debug.dont_blame_oasis \ + --debug.allow_test_keys \ + --consim.workload xfer \ + --consim.workload.xfer.iterations 10000 \ + --consim.num_kept 1 \ + --consim.memdb diff --git a/tests/fixture-data/consim/genesis.json b/tests/fixture-data/consim/genesis.json new file mode 100644 index 00000000000..bdb2dcca4ff --- /dev/null +++ b/tests/fixture-data/consim/genesis.json @@ -0,0 +1 @@ +{"height":0,"genesis_time":"2020-04-01T11:27:11.906400344Z","chain_id":"test","epochtime":{"params":{"interval":86400,"debug_mock_backend":false},"base":0},"registry":{"params":{"gas_costs":{"deregister_entity":1000,"register_entity":1000,"register_node":1000,"register_runtime":1000,"runtime_epoch_maintenance":1000,"unfreeze_node":1000,"update_keymanager":1000},"max_node_expiration":5},"entities":[{"untrusted_raw_value":"o2JpZFggTqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TVlbm9kZXP2eBlhbGxvd19lbnRpdHlfc2lnbmVkX25vZGVz9Q==","signature":{"public_key":"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=","signature":"5CnlsannKM749UmwEadxMJ6WTAQA4tffytgwUm8WLYdpcMEBXv9aK4qwATUrO5O3hJyob0uCRRX3MHk8o/qWDw=="}}]},"roothash":{"params":{"gas_costs":{"compute_commit":1000,"merge_commit":1000}}},"staking":{"params":{"thresholds":{"0":"0","1":"0","2":"0","3":"0","4":"0","5":"0","6":"0"},"debonding_interval":2,"commission_schedule_rules":{"rate_change_interval":10,"rate_bound_lead":30,"max_rate_steps":12,"max_bound_steps":12},"gas_costs":{"add_escrow":10,"burn":10,"reclaim_escrow":10,"transfer":10},"min_delegation":"0","fee_split_weight_propose":"2","fee_split_weight_vote":"1","fee_split_weight_next_propose":"1","reward_factor_epoch_signed":"0","reward_factor_block_proposed":"0"},"total_supply":"290000000000","common_pool":"0","last_block_fees":"0","ledger":{"B14NG+Joea3j09rVt0SEPQ4Z6Ned1EEi6rzZoa2YrYw=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"DbeoxcRwDO4Wh8bwq5rAR7wzhiB+LeYn+y7lFSGAZ7I=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"IluobMWMoZvxeW5ceAEiQj+TJUXZZJu6ZCWgtZxsHds=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"LQu4ZtFg8OJ0MC4M4QMeUR7Is6Xt4A/CW+PK/7TPiH0=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=":{"general":{"balance":"100000000000","nonce":0},"escrow":{"active":{"balance":"100000000000","total_shares":"1"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"hcWVUucu/MwOyEDmj5T4TACwpgre5e2cJLczBggxxm0=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"iPYyR3I45FRGK568PTJIZUmELgcFYPhIb80e2GxrIf0=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"mh+b9hN+2oLAflZACgBgVHA0EjeZK3ew6kml75s2wN4=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"oWk0qdNhp7XNQDX4YFJY2KeFM+9u4fo16DeSdW1gChg=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}},"toAWSrxsxSFbGXQIhu4p2fOL0z/fnirrGT/MuzRgcW8=":{"general":{"balance":"10000000000","nonce":0},"escrow":{"active":{"balance":"0","total_shares":"0"},"debonding":{"balance":"0","total_shares":"0"},"commission_schedule":{"rates":null,"bounds":null},"stake_accumulator":{}}}},"delegations":{"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=":{"TqUyj5Q+9vZtqu10yw6Zw7HEX3Ywe0JQA9vHyzY47TU=":{"shares":"1"}}}},"keymanager":{},"scheduler":{"params":{"min_validators":1,"max_validators":100,"max_validators_per_entity":1,"debug_bypass_stake":false,"debug_static_validators":false,"reward_factor_epoch_election_any":"0"}},"beacon":{"params":{"debug_deterministic":false}},"consensus":{"backend":"tendermint","params":{"timeout_commit":1000000000,"skip_timeout_commit":false,"empty_block_interval":0,"max_tx_size":32768,"max_block_size":22020096,"max_block_gas":0,"max_evidence_age":100000}},"halt_epoch":18446744073709551615,"extra_data":null} \ No newline at end of file