-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
l:SSolving this issue takes hoursSolving this issue takes hoursp:highHigh priority, prioritize the resolution of this issueHigh priority, prioritize the resolution of this issuet:enhancementThe issue described an enhancementThe issue described an enhancement
Description
Currently only the client upgrade of the zeitgeist main-net is tested before applying upgrades to the networks.
zeitgeist/integration-tests/tests/rt-upgrade-zombienet/test-zombienet-runtime-upgrade.ts
Lines 30 to 125 in 91627e3
| describeSuite({ | |
| id: "R01", | |
| title: "Zombie Zeitgeist Upgrade Test", | |
| foundationMethods: "zombie", | |
| testCases: function ({ it, context, log }) { | |
| let paraApi: ApiPromise; | |
| let relayApi: ApiPromise; | |
| let alice: KeyringPair; | |
| beforeAll(async () => { | |
| const keyring = new Keyring({ type: "sr25519" }); | |
| alice = keyring.addFromUri("//Alice", { name: "Alice default" }); | |
| paraApi = context.polkadotJs("parachain"); | |
| relayApi = context.polkadotJs("Relay"); | |
| const relayNetwork = ( | |
| relayApi.consts.system.version as unknown as RuntimeVersion | |
| ).specName.toString(); | |
| expect(relayNetwork, "Relay API incorrect").to.contain("rococo"); | |
| const paraNetwork = ( | |
| paraApi.consts.system.version as unknown as RuntimeVersion | |
| ).specName.toString(); | |
| expect(paraNetwork, "Para API incorrect").to.contain("zeitgeist"); | |
| const currentBlock = ( | |
| await paraApi.rpc.chain.getBlock() | |
| ).block.header.number.toNumber(); | |
| expect(currentBlock, "Parachain not producing blocks").to.be.greaterThan( | |
| 0 | |
| ); | |
| }, 120000); | |
| it({ | |
| id: "T01", | |
| title: "Blocks are being produced on parachain", | |
| test: async function () { | |
| const blockNum = ( | |
| await paraApi.rpc.chain.getBlock() | |
| ).block.header.number.toNumber(); | |
| expect(blockNum).to.be.greaterThan(0); | |
| }, | |
| }); | |
| it({ | |
| id: "T02", | |
| title: "Chain can be upgraded", | |
| timeout: 600000, | |
| test: async function () { | |
| const blockNumberBefore = ( | |
| await paraApi.rpc.chain.getBlock() | |
| ).block.header.number.toNumber(); | |
| const currentCode = await paraApi.rpc.state.getStorage(":code"); | |
| const codeString = currentCode.toString(); | |
| const moonwallContext = await MoonwallContext.getContext(); | |
| log( | |
| "Moonwall Context providers: " + | |
| moonwallContext.providers.map((p) => p.name).join(", ") | |
| ); | |
| const wasm = fs.readFileSync(moonwallContext.rtUpgradePath); | |
| const rtHex = `0x${wasm.toString("hex")}`; | |
| if (rtHex === codeString) { | |
| log("Runtime already upgraded, skipping test"); | |
| return; | |
| } else { | |
| log("Runtime not upgraded, proceeding with test"); | |
| log( | |
| "Current runtime hash: " + | |
| rtHex.slice(0, 10) + | |
| "..." + | |
| rtHex.slice(-10) | |
| ); | |
| log( | |
| "New runtime hash: " + | |
| codeString.slice(0, 10) + | |
| "..." + | |
| codeString.slice(-10) | |
| ); | |
| } | |
| await context.upgradeRuntime({ from: alice, logger: log }); | |
| await context.waitBlock(2); | |
| const blockNumberAfter = ( | |
| await paraApi.rpc.chain.getBlock() | |
| ).block.header.number.toNumber(); | |
| log(`Before: #${blockNumberBefore}, After: #${blockNumberAfter}`); | |
| expect( | |
| blockNumberAfter, | |
| "Block number did not increase" | |
| ).to.be.greaterThan(blockNumberBefore); | |
| }, | |
| }); | |
| }, | |
| }); |
Ideally the battery station upgrade for the client should also be tested using zombienet.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
l:SSolving this issue takes hoursSolving this issue takes hoursp:highHigh priority, prioritize the resolution of this issueHigh priority, prioritize the resolution of this issuet:enhancementThe issue described an enhancementThe issue described an enhancement