Browse Source

post migration assertions updated to account for migration status & WGs

ignazio 3 years ago
parent
commit
cd5072be2a

+ 1 - 1
tests/network-tests/run-migration-tests.sh

@@ -304,4 +304,4 @@ function main {
 
 # main entrypoint
 main
-#cleanup
+cleanup

+ 25 - 6
tests/network-tests/src/misc/postMigrationAssertionsFlow.ts

@@ -6,24 +6,43 @@ export default async function postMigrationAssertions({ api }: FlowProps): Promi
     const debug = extendDebug('flow:postMigrationAssertions')
     debug('Started')
 
-    // check that counters haven't been re-set        
+    debug('Ensure migration is done')
+
+    const channel_migration = await api.query.content.channelMigration();
+    const video_migration = await api.query.content.videoMigration();
+
+    assert(channel_migration.current_id.toNumber() == channel_migration.final_id.toNumber())
+    assert(video_migration.current_id.toNumber() == video_migration.final_id.toNumber())
+
+    debug('Check all working groups have been correctly created')
+    const wg_alpha = await api.query.operationsWorkingGroupAlpha.activeWorkerCount();
+    const wg_beta = await api.query.operationsWorkingGroupBeta.activeWorkerCount();
+    const wg_gamma = await api.query.operationsWorkingGroupGamma.activeWorkerCount();
+    const wg_gateway = await api.query.gatewayWorkingGroup.activeWorkerCount();
+    const wg_content = await api.query.contentWorkingGroup.activeWorkerCount();
+
+    assert(wg_alpha.toNumber() === 0);
+    assert(wg_beta.toNumber() === 0);
+    assert(wg_gamma.toNumber() === 0);
+    assert(wg_gateway.toNumber() === 0);
+    assert(wg_content.toNumber() === 0);
+
     debug('Checking that Video, Channel, Categories  counters have not been re-set')
 
     const nextVideoCategoryId = await api.query.content.nextVideoCategoryId()
     const nextVideoId = await api.query.content.nextVideoId()
     const nextChannelId = await api.query.content.nextChannelId()
 
-    const num_channels = await api.getNumberOfOutstandingChannels()
-    const num_videos = await api.getNumberOfOutstandingVideos()
-    const num_categories = await api.getNumberOfOutstandingVideoCategories()
-
     assert(nextVideoCategoryId.toNumber() > 1);
     assert(nextVideoId.toNumber() > 1);
     assert(nextChannelId.toNumber() > 1);
 
-    // asserting the number of outstanding channel & videos is 0
     debug('Checking that number of outstanding channels & videos == 0');
 
+    const num_channels = await api.getNumberOfOutstandingChannels()
+    const num_videos = await api.getNumberOfOutstandingVideos()
+    const num_categories = await api.getNumberOfOutstandingVideoCategories()
+
     assert(num_channels === 0);
     assert(num_videos === 0);
     assert(num_categories === 0);