Skip to content

Commit

Permalink
feat: added new smoke test aggregation of multiple tests for podman ci
Browse files Browse the repository at this point in the history
  • Loading branch information
l0r1s committed Apr 25, 2023
1 parent 5ac57de commit c0408da
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/smoke/0001-custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
async function run(nodeName, networkInfo, args) {
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
const validator = await api.query.session.validators();
return validator.length;
}

module.exports = { run }
2 changes: 2 additions & 0 deletions tests/smoke/0001-custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# just echo for this test
echo "OK"
33 changes: 33 additions & 0 deletions tests/smoke/0001-smoke.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# cover 0002 / 0006 / 0007 / 0008 / 0010 / 0011
[settings]
timeout = 1000

[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
chain = "rococo-local"
command = "polkadot"

[relaychain.genesis.runtime.runtime_genesis_config.configuration.config]
max_validators_per_core = 2
needed_approvals = 2


[[relaychain.nodes]]
name = "alice"

[[relaychain.nodes]]
name = "bob"

[[parachains]]
id = 100
add_to_genesis = true

[parachains.collator]
name = "collator01"
image = "{{COL_IMAGE}}"
command = "adder-collator"

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
41 changes: 41 additions & 0 deletions tests/smoke/0001-smoke.zndsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Description: Smoke Test
Network: ./0001-smoke.toml
Creds: config

alice: is up
bob: is up

# Logs assertions
alice: reports block height is at least 4 within 200 seconds
alice: log line contains "Imported #2" within 20 seconds
alice: log line matches glob "*rted #1*" within 10 seconds
alice: log line matches "Imported #[0-9]+" within 10 seconds
alice: count of log lines containing "imported" is at least 4 within 10 seconds


# Events assertions
alice: system event contains "A candidate was included" within 60 seconds
alice: system event matches glob "*was backed*" within 20 seconds
alice: system event matches "paraId(.)*[0-9]+" within 20 seconds

# Custom scripts
alice: js-script ./0001-custom.js return is greater than 1 within 200 seconds
alice: js-script ./0001-custom.js within 200 seconds
alice: js-script ./0001-custom.js with "alice" within 200 seconds
alice: run ./0001-custom.sh within 200 seconds

# Histogram assertions
alice: reports histogram polkadot_pvf_execution_time has at least 2 samples in buckets ["0.01"] within 100 seconds

# restart / pause / resume
bob: pause
collator01: pause
alice: is up
alice: restart after 20 seconds
sleep 25 seconds
alice: is up
alice: pause
# Todo add `should fail` support
# alice: is down
alice: resume
alice: is up within 120 seconds

0 comments on commit c0408da

Please sign in to comment.