소스 검색

Execution time improvement (#14)

fixed election parameters tests to work with altered block generation time, new chainspec built but removed from CI
gleb-urvanov 4 년 전
부모
커밋
4c2c0d6095

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

@@ -9,6 +9,10 @@
       include_role:
         name: install_dependencies
 
+    - name: alter block creation time
+      include_role:
+        name: alter_block_creation_time
+
     - name: build node
       include_role:
         name: build_docker_image

+ 4 - 0
devops/ansible/build-and-run-tests-single-node-playbook.yml

@@ -9,6 +9,10 @@
       include_role:
         name: install_dependencies
 
+    - name: alter block creation time
+      include_role:
+        name: alter_block_creation_time
+
     - name: build node
       include_role:
         name: build_docker_image

+ 6 - 1
devops/ansible/build-and-run-tests-two-nodes-playbook.yml

@@ -4,14 +4,19 @@
   become_method: sudo
 
   tasks:
+
     - name: install dependencies
       include_role:
         name: install_dependencies
 
+    - name: alter block creation time
+      include_role:
+        name: alter_block_creation_time
+
     - name: build node
       include_role:
         name: build_docker_image
-        
+
     - name: run tests
       include_role:
         name: run_tests_two_nodes

+ 6 - 1
devops/ansible/build-image-playbook.yml

@@ -4,10 +4,15 @@
   become_method: sudo
 
   tasks:
+
     - name: install dependencies
       include_role:
         name: install_dependencies
 
+    - name: alter block creation time
+      include_role:
+        name: alter_block_creation_time
+
     - name: build node
       include_role:
-        name: build_docker_image
+        name: build_docker_image

+ 4 - 0
devops/ansible/roles/alter_block_creation_time/tasks/main.yml

@@ -0,0 +1,4 @@
+- name: alter block creation time
+  shell: ./scripts/alter-block-creation-time.sh
+  args:
+    chdir: ../../

+ 4 - 0
scripts/alter-block-creation-time.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+perl -i -pe's/pub const MILLISECS_PER_BLOCK: Moment = 6000;/pub const MILLISECS_PER_BLOCK: Moment = 2000;/' runtime/src/constants.rs
+perl -i -pe's/pub const SLOT_DURATION: Moment = 6000;/pub const SLOT_DURATION: Moment = 2000;/' runtime/src/constants.rs

+ 0 - 7
scripts/build-joystream-testing-node-docker-image.sh

@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-
-# Build the node and runtime image
-docker build --tag joystream/node-testing \
-    --file ./devops/dockerfiles/ansible-node/Dockerfile \
-    .
-

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
testnets/nicaea-exported-state/chain_spec.json


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 59
testnets/nicaea-exported-state/raw_chain_spec.json


+ 4 - 4
tests/network-tests/src/iznik/tests/fixtures/proposalsModule.ts

@@ -561,12 +561,12 @@ export class ElectionParametersProposalFixture implements Fixture {
     const description: string = 'Testing validator count proposal ' + uuid().substring(0, 8)
     const runtimeVoteFee: BN = this.apiWrapper.estimateVoteForProposalFee()
     await this.apiWrapper.transferBalanceToAccounts(this.treasury, this.councilKeyPairs, runtimeVoteFee)
-    const announcingPeriod: BN = await this.apiWrapper.getAnnouncingPeriod()
-    const votingPeriod: BN = await this.apiWrapper.getVotingPeriod()
-    const revealingPeriod: BN = await this.apiWrapper.getRevealingPeriod()
+    const announcingPeriod: BN = new BN(28800)
+    const votingPeriod: BN = new BN(14400)
+    const revealingPeriod: BN = new BN(14400)
     const councilSize: BN = await this.apiWrapper.getCouncilSize()
     const candidacyLimit: BN = await this.apiWrapper.getCandidacyLimit()
-    const newTermDuration: BN = await this.apiWrapper.getNewTermDuration()
+    const newTermDuration: BN = new BN(144000)
     const minCouncilStake: BN = await this.apiWrapper.getMinCouncilStake()
     const minVotingStake: BN = await this.apiWrapper.getMinVotingStake()
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.