Repository: paritytech/polkadot-sdk (language: rust)

Issue:
omni-node: Add test for dev-mode
We should have a integration test or a zombienet test that verifies that freshly built runtimes are able to produce some blocks without error when passed to an omninode in dev mode.


Discussion / hints:
am taking it @skunert 
Thank you! 
We actually have some tests already that you can take inspiration from: https://github.com/paritytech/polkadot-sdk/blob/4c28354be1f5eec875d116a1ab7d9429023ef83b/docs/sdk/src/guides/your_first_node.rs#L121-L121

What I would like to see is a test that checks that the dev-mode works with the chain-spec that is present [here](https://github.com/paritytech/polkadot-sdk/blob/4c28354be1f5eec875d116a1ab7d9429023ef83b/templates/parachain/dev_chain_spec.json#L1-L1) . Support for this chain-spec broke silently and we should detect it.

Fix patch:
diff --git a/docs/sdk/src/guides/your_first_node.rs b/docs/sdk/src/guides/your_first_node.rs
index 3c782e4793bab..90fa8639f7577 100644
--- a/docs/sdk/src/guides/your_first_node.rs
+++ b/docs/sdk/src/guides/your_first_node.rs
@@ -305,4 +305,33 @@ mod tests {
 			test_runtime_preset(FIRST_RUNTIME, 1000, preset);
 		});
 	}
+
+	#[test]
+	fn omni_node_dev_mode_works() {
+		//Omni Node in dev mode works with parachain's template `dev_chain_spec`
+		let dev_chain_spec = std::env::current_dir()
+			.unwrap()
+			.parent()
+			.unwrap()
+			.parent()
+			.unwrap()
+			.join("templates")
+			.join("parachain")
+			.join("dev_chain_spec.json");
+
+		maybe_build_omni_node();
+		let omni_node = find_release_binary(OMNI_NODE).unwrap();
+
+		let output = Command::new(omni_node)
+			.arg("--dev")
+			.args(["--chain", dev_chain_spec.to_str().unwrap()])
+			.timeout(std::time::Duration::from_secs(70))
+			.output()
+			.unwrap();
+
+		// atleast  blocks should be imported
+		assert!(String::from_utf8(output.stderr)
+			.unwrap()
+			.contains(format!("Imported #{}", 7).to_string().as_str()));
+	}
 }


Test patch: