git.delta.rocks / unique-network / refs/commits / 307e69b41531

difftreelog

skip worflow if already upgraded

Max Andreev2023-06-12parent: #058c022.patch.diff
in: master
- fix manual migration script: use dirname
- update envs

3 files changed

modified.envdiffbeforeafterboth
17KARURA_BUILD_BRANCH=release-karura-2.17.017KARURA_BUILD_BRANCH=release-karura-2.17.0
18MOONRIVER_BUILD_BRANCH=runtime-230218MOONRIVER_BUILD_BRANCH=runtime-2302
19SHIDEN_BUILD_BRANCH=v5.4.019SHIDEN_BUILD_BRANCH=v5.4.0
20QUARTZ_MAINNET_BRANCH=release-v94105520QUARTZ_MAINNET_BRANCH=release-v941056
21QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:44321QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443
2222
23UNIQUEWEST_MAINNET_BRANCH=release-v0.9.4223UNIQUEWEST_MAINNET_BRANCH=release-v0.9.42
24WESTMINT_BUILD_BRANCH=parachains-v942024WESTMINT_BUILD_BRANCH=parachains-v9420
25OPAL_MAINNET_BRANCH=release-v94105525OPAL_MAINNET_BRANCH=release-v942057
26OPAL_REPLICA_FROM=wss://ws-opal.unique.network:44326OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443
2727
28UNIQUEEAST_MAINNET_BRANCH=release-v0.9.4228UNIQUEEAST_MAINNET_BRANCH=release-v0.9.42
modifiedtests/src/migrations/942057-appPromotion/lockedToFreeze.tsdiffbeforeafterboth
--- 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;
modifiedtests/src/util/frankenstein.tsdiffbeforeafterboth
--- 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<void> => {
+  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