Browse Source

added playbook for testing with exported state

Gleb Urvanov 4 years ago
parent
commit
040e90a170

+ 18 - 0
devops/ansible/build-and-run-tests-exported-chainspec-playbook.yml

@@ -0,0 +1,18 @@
+- hosts: 127.0.0.1
+  user: root
+  become: yes
+  become_method: sudo
+
+  tasks:
+
+    - name: install dependencies
+      include_role:
+        name: install_dependencies
+
+    - name: build node
+      include_role:
+        name: build_docker_image
+
+    - name: run tests
+      include_role:
+        name: run_tests_exported_chainspec

+ 38 - 0
devops/ansible/roles/run_tests_exported_chainspec/tasks/main.yml

@@ -0,0 +1,38 @@
+- name: run network
+  block:
+    - name: yarn install for joystream types
+      shell: yarn workspace @joystream/types install
+
+    - name: yarn build for joystream types
+      shell: yarn workspace @joystream/types build
+
+    - name: yarn install for network tests
+      shell: yarn workspace joystream-testing install
+
+    - name: run docker container
+      docker_container:
+        name: "joystream-node"
+        image: "joystream/node"
+        ports:
+          - "9944:9944"
+        mounts:
+          - target: /testnet-state
+            source: "{{ playbook_dir }}/../../testnets/nicaea-exported-state"
+            type: bind
+            read_only: yes
+        entrypoint: ./node --chain ../testnet-state/chain_spec.json --alice --validator --unsafe-ws-external --rpc-cors=all
+        state: started
+
+    - name: execute network tests
+      shell: yarn test >> ../../.tmp/tests.log
+      args:
+        chdir: ../../tests/network-tests/
+
+  always:
+    - name: display tests log
+      shell: cat ../../.tmp/tests.log
+
+    - name: stop docker container
+      docker_container:
+        name: "joystream-node-testing"
+        state: absent

+ 0 - 3
devops/ansible/roles/run_tests_single_node/tasks/main.yml

@@ -15,9 +15,6 @@
         image: "joystream/node"
         ports:
           - "9944:9944"
-        mounts:
-          target: /testnet-state
-          source: ../../testnets/nicaea-export-state
         entrypoint: ./node --dev --alice --validator --unsafe-ws-external --rpc-cors=all
         state: started
 

File diff suppressed because it is too large
+ 21 - 0
testnets/nicaea-exported-state/chain_spec.json


File diff suppressed because it is too large
+ 81 - 0
testnets/nicaea-exported-state/raw-chain-spec.json


Some files were not shown because too many files changed in this diff