Skip to content
This repository was archived by the owner on Apr 8, 2022. It is now read-only.
Merged
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
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
with:
submodules: recursive
- name: Build
run: cargo build --release
run: cargo build --release --features short-block-time
- name: Run tests
run: cargo test --release
run: cargo test --release --features short-block-time
- name: Prepare functional tests
uses: actions/setup-python@v2
with:
Expand All @@ -79,4 +79,10 @@ jobs:
- name: Install scalecodec
run: python -m pip install 'scalecodec == 0.11.18'
- name: Run functional tests
run: python test/functional/test_runner.py
run: python test/functional/test_runner.py --jobs 1
- name: Save test artifacts on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: functional-tests-logs
path: /tmp/mintlayer*
1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ path = "../pallets/pp"

[features]
default = ['std']
short-block-time = []
runtime-benchmarks = [
'frame-benchmarking',
'frame-support/runtime-benchmarks',
Expand Down
5 changes: 4 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// up by `pallet_aura` to implement `fn slot_duration()`.
///
/// Change this to adjust the block time.
pub const MILLISECS_PER_BLOCK: u64 = 60_000; //1 min
#[cfg(not(feature = "short-block-time"))]
pub const MILLISECS_PER_BLOCK: u64 = 60_000; // 1 min
#[cfg(feature = "short-block-time")]
pub const MILLISECS_PER_BLOCK: u64 = 3_000; // 3 sec

// NOTE: Currently it is not possible to change the slot duration after the chain has started.
// Attempting to do so will brick block production.
Expand Down
5 changes: 3 additions & 2 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mo
if timewait:
self.rpc_timeout = timewait
else:
# Wait for up to 600 seconds for the RPC server to respond
self.rpc_timeout = 600
# Wait for up to 120 seconds for the RPC server to respond
self.rpc_timeout = 120
if binary is None:
self.binary = os.getenv("NODEEXE", "mintlayer-core")
else:
Expand All @@ -65,6 +65,7 @@ def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mo
port_rpc = rpc_port(i)
port_p2p = p2p_port(i)
self.args = [self.binary, "--dev",
"--database", "paritydb-experimental",
"--base-path", self.datadir,
"--log", "trace",
"--name", "testnode%d" % i,
Expand Down
10 changes: 9 additions & 1 deletion test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@ def get_next(self):
log_stderr))
if not self.jobs:
raise IndexError('pop from empty list')

# print test names that are running
running_test_names = [test_data[0] for test_data in self.jobs]
running_test_names_list = ["{}{}{}".format(BOLD[1], nm, BOLD[0]) for nm in running_test_names]
running_test_names_list = ", ".join(running_test_names_list)
logging.debug("Test%s currently running: %s", "s" if len(running_test_names) > 1 else "", running_test_names_list)

while True:
# Return first proc that finishes
time.sleep(.5)
Expand All @@ -336,6 +343,7 @@ def get_next(self):
# providing useful output.
proc.send_signal(signal.SIGINT)
if proc.poll() is not None:
# check if the test has finished
log_out.seek(0), log_err.seek(0)
[stdout, stderr] = [l.read().decode('utf-8') for l in (log_out, log_err)]
log_out.close(), log_err.close()
Expand Down Expand Up @@ -403,7 +411,7 @@ def check_script_list(src_dir):
python_files = set([t for t in os.listdir(script_dir) if t[-3:] == ".py"])
missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))
if len(missed_tests) != 0:
print("%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py." % (BOLD[1], BOLD[0], str(missed_tests)))
print("%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py." % (BOLD[1], BOLD[0], str(missed_tests)), flush=True)
if os.getenv('TRAVIS') == 'true':
# On travis this warning is an error to prevent merging incomplete commits into master
sys.exit(1)
Expand Down