diff --git a/tests/smoke/0001-custom.js b/tests/smoke/0001-custom.js new file mode 100644 index 000000000..b2ac423da --- /dev/null +++ b/tests/smoke/0001-custom.js @@ -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 } \ No newline at end of file diff --git a/tests/smoke/0001-custom.sh b/tests/smoke/0001-custom.sh new file mode 100644 index 000000000..a063a97ea --- /dev/null +++ b/tests/smoke/0001-custom.sh @@ -0,0 +1,2 @@ +# just echo for this test +echo "OK" \ No newline at end of file diff --git a/tests/smoke/0001-smoke.toml b/tests/smoke/0001-smoke.toml new file mode 100644 index 000000000..246a1bf4b --- /dev/null +++ b/tests/smoke/0001-smoke.toml @@ -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" \ No newline at end of file diff --git a/tests/smoke/0001-smoke.zndsl b/tests/smoke/0001-smoke.zndsl new file mode 100644 index 000000000..34f6a1237 --- /dev/null +++ b/tests/smoke/0001-smoke.zndsl @@ -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