Parcourir la source

Joystream CLI initialization, uncomment cleanup code

Leszek Wiesner il y a 3 ans
Parent
commit
30dfd7aedc

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

@@ -6,12 +6,12 @@ cd $SCRIPT_PATH
 
 CONTAINER_ID=$(./run-test-node-docker.sh)
 
-# function cleanup() {
-#     docker logs ${CONTAINER_ID} --tail 15
-#     docker-compose -f ../../docker-compose.yml down -v
-# }
+function cleanup() {
+    docker logs ${CONTAINER_ID} --tail 15
+    docker-compose -f ../../docker-compose.yml down -v
+}
 
-# trap cleanup EXIT
+trap cleanup EXIT
 
 sleep 3
 

+ 5 - 0
tests/network-tests/src/cli/joystream.ts

@@ -16,6 +16,11 @@ export class JoystreamCLI extends CLI {
     this.tmpFileManager = tmpFileManager
   }
 
+  async init(): Promise<void> {
+    await this.run('api:setUri', [process.env.NODE_URL || 'ws://127.0.0.1:9944'])
+    await this.run('api:setQueryNodeEndpoint', [process.env.QUERY_NODE_URL || 'http://127.0.0.1:8081/graphql'])
+  }
+
   async importKey(pair: KeyringPair): Promise<void> {
     const jsonFile = this.tmpFileManager.jsonFile(pair.toJson())
     await this.run('account:import', [jsonFile])

+ 2 - 1
tests/network-tests/src/flows/clis/createChannel.ts

@@ -27,7 +27,8 @@ export default async function createChannel({ api, env, query }: FlowProps): Pro
   const tmpFileManager = new TmpFileManager()
   const joystreamCli = new JoystreamCLI(tmpFileManager)
 
-  // Import & select channel owner key in Joystream CLI
+  // Init CLI, import & select channel owner key
+  await joystreamCli.init()
   await joystreamCli.importKey(channelOwnerKeypair.key)
   await joystreamCli.chooseKey(channelOwnerKeypair.key.address)