Runtime Upgrades

You can simulate runtime upgrades in your code by authoring extrinsics for any account. The ease of this process may depend on whether your runtime has pallet-sudo or pallet-democracy.
If you have pallet-sudo then upgrading your runtime is as easy as authoring the frame_system::Call::set_code extrinsic using the sudo account. On the other hand if you have pallet-democracy then you’ll need to propose the runtime upgrade in simnode, upgrade it to a referrendum, vote for it using any account on-chain with a balance, and finally produce enough blocks that makes the enactment period configured in your runtime pass. Here’s an example of what that looked like in polkadot for an earlier version of simnode.

Parachains

It’s probably a good idea to have this test automated and running in CI for every code that changes your runtime. Here’s an example of what that looks like.