From 307e69b41531d8790342ba6c71005402626b2451 Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Mon, 12 Jun 2023 17:13:35 +0000 Subject: [PATCH] skip worflow if already upgraded - fix manual migration script: use dirname - update envs --- --- a/.env +++ b/.env @@ -17,12 +17,12 @@ KARURA_BUILD_BRANCH=release-karura-2.17.0 MOONRIVER_BUILD_BRANCH=runtime-2302 SHIDEN_BUILD_BRANCH=v5.4.0 -QUARTZ_MAINNET_BRANCH=release-v941055 +QUARTZ_MAINNET_BRANCH=release-v941056 QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443 UNIQUEWEST_MAINNET_BRANCH=release-v0.9.42 WESTMINT_BUILD_BRANCH=parachains-v9420 -OPAL_MAINNET_BRANCH=release-v941055 +OPAL_MAINNET_BRANCH=release-v942057 OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443 UNIQUEEAST_MAINNET_BRANCH=release-v0.9.42 --- a/tests/src/migrations/942057-appPromotion/lockedToFreeze.ts +++ b/tests/src/migrations/942057-appPromotion/lockedToFreeze.ts @@ -1,8 +1,9 @@ // import { usingApi, privateKey, onlySign } from "./../../load/lib"; import * as fs from 'fs'; import {usingPlaygrounds} from '../../util'; -import path from 'path'; +import path, {dirname} from 'path'; import {isInteger, parse} from 'lossless-json'; +import {fileURLToPath} from 'url'; const WS_ENDPOINT = 'ws://localhost:9944'; @@ -32,7 +33,8 @@ // 3. Parse data to migrate console.log('3. Parsing chainql results...'); - const parsingResult = parse(fs.readFileSync(path.resolve('src', 'migrations', '942057-appPromotion', 'output.json'), 'utf-8'), undefined, customNumberParser); + const dirName = dirname(fileURLToPath(import.meta.url)); + const parsingResult = parse(fs.readFileSync(path.resolve(dirName, 'output.json'), 'utf-8'), undefined, customNumberParser); const chainqlImportData = parsingResult as { address: string; --- a/tests/src/util/frankenstein.ts +++ b/tests/src/util/frankenstein.ts @@ -105,7 +105,18 @@ } } +async function skipIfAlreadyUpgraded() { + await usingPlaygrounds(async (helper) => { + const specVersion = await getSpecVersion(helper.getApi()); + if(`v${specVersion}` === DESTINATION_SPEC_VERSION) { + console.log('\n🛸 Current version equal DESTINATION_SPEC_VERSION 🛸'); + console.log("\n🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"); + } + }, REPLICA_FROM); +} + const raiseZombienet = async (): Promise => { + await skipIfAlreadyUpgraded(); const isUpgradeTesting = !!NEW_RELAY_BIN || !!NEW_RELAY_WASM || !!NEW_PARA_BIN || !!NEW_PARA_WASM; /* // If there is nothing to upgrade, what is the point -- gitstuff