Browse Source

migration tests first attempt

ignazio-bovo 3 years ago
parent
commit
dee2854e3b

+ 5 - 1
tests/network-tests/run-migration-tests.sh → tests/network-tests/post_migration_hook.sh

@@ -4,10 +4,14 @@ set -e
 SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
 cd $SCRIPT_PATH
 
-# verify existence of the three new groups
+echo "verify existence of the 5 new groups"
 yarn joystream-cli working-groups:overview --group=operationsAlpha
 yarn joystream-cli working-groups:overview --group=operationsBeta
 yarn joystream-cli working-groups:overview --group=operationsGamma
 yarn joystream-cli working-groups:overview --group=curators
 yarn joystream-cli working-groups:overview --group=distributors
 
+echo "verify video by id map and channel by id map are cleared"
+yarn joystream-cli content:channel 0
+yarn joystream-cli content:videos 0
+

+ 9 - 0
tests/network-tests/pre_migration_hook.sh

@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+set -e
+
+SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
+cd $SCRIPT_PATH
+
+echo "creating 1 channel with 1 video in it"
+yarn joystream-cli content:createChannel -i ./assets/TestChannel.json
+yarn joystream-cli content:createChannel -c 0 -i ./assets/TestVideo.json

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

@@ -76,6 +76,9 @@ trap cleanup EXIT
 if [ "$TARGET_RUNTIME" == "$RUNTIME" ]; then
   echo "Not Performing a runtime upgrade."
 else
+  # pre migration hook
+  ./pre_migration_hook.sh $1    
+    
   # Copy new runtime wasm file from target joystream/node image
   echo "Extracting wasm blob from target joystream/node image."
   id=`docker create joystream/node:${TARGET_RUNTIME}`
@@ -92,7 +95,8 @@ else
   echo "Runtime upgraded."
 
   echo "Performing migration tests"
-  ./run-migration-tests.sh $1
+  # post migration hook
+  ./post_migration_hook.sh $1
   echo "Done with migrations tests"
 fi