Browse Source

tests - active video counters improvements VIII

ondratra 3 years ago
parent
commit
6488aee965

+ 3 - 1
tests/network-tests/run-full-tests.sh

@@ -21,8 +21,10 @@ yarn workspace api-scripts tsnode-strict src/status.ts | grep Runtime
 # Start a query-node
 ../../query-node/start.sh
 
+./run-test-scenario.sh proposals
+
 # Start storage and distribution services
-./start-storage.sh
+REUSE_KEYS=true ./start-storage.sh
 
 # Run combined tests reusing the existing keys
 REUSE_KEYS=true ./run-test-scenario.sh combined

+ 1 - 1
tests/network-tests/src/cli/utils.ts

@@ -18,7 +18,7 @@ export class TmpFileManager {
     )
     mkdirSync(this.tmpDataDir, { recursive: true })
     nodeCleanup(() => {
-      //      rmSync(this.tmpDataDir, { recursive: true, force: true })
+      rmSync(this.tmpDataDir, { recursive: true, force: true })
     })
   }
 

+ 3 - 3
tests/network-tests/src/fixtures/content/activeVideoCounters.ts

@@ -11,6 +11,7 @@ import { PaidTermId, MemberId } from '@joystream/types/members'
 import { Debugger, extendDebug } from '../../Debugger'
 import BN from 'bn.js'
 import { Worker, WorkerId } from '@joystream/types/working-group'
+import { Utils } from '../../utils'
 
 import {
   getMemberDefaults,
@@ -129,9 +130,8 @@ export class ActiveVideoCountersFixture extends BaseQueryNodeFixture {
     const getterName = `${entityName}ById` as 'channelById' | 'channelCategoryById' | 'videoCategoryById'
     await this.query.tryQueryWithTimeout(
       () => this.query[getterName](entityId.toString()),
-      (tmpEntity) => {
-        assert(tmpEntity)
-        const entity = tmpEntity as Exclude<typeof tmpEntity, null>
+      (entity) => {
+        Utils.assert(entity)
 
         // all videos created in this fixture should be active and belong to first entity
         assert(entity.activeVideosCounter === expectedCount)

+ 4 - 10
tests/network-tests/start-storage.sh

@@ -1,21 +1,15 @@
 TMP=$0
 THIS_DIR=`dirname $TMP`
 
-# Run proposals tests first, since they require no leads hired
-$THIS_DIR/run-test-scenario.sh proposals
+set -a
+. ../../.env
+set +a
 
-# Setup storage & distribution
 HOST_IP=`$THIS_DIR/get-host-ip.sh`
-# Because proposals tests hire and then fire each lead,
-# we need to override COLOSSUS_1_WORKER_ID (0 => 1) and DISTRIBUTOR_1_WORKER_ID (0 => 1)
 export COLOSSUS_1_URL="http://${HOST_IP}:3333"
-export COLOSSUS_1_WORKER_ID=1
-export COLOSSUS_1_WORKER_URI=//testing//worker//Storage//${COLOSSUS_1_WORKER_ID}
 export COLOSSUS_1_TRANSACTOR_KEY=$(docker run --rm --pull=always docker.io/parity/subkey:2.0.1 inspect ${COLOSSUS_1_TRANSACTOR_URI} --output-type json | jq .ss58Address -r)
 export DISTRIBUTOR_1_URL="http://${HOST_IP}:3334"
-export DISTRIBUTOR_1_WORKER_ID=1
-export DISTRIBUTOR_1_ACCOUNT_URI=//testing//worker//Distribution//${DISTRIBUTOR_1_WORKER_ID}
-REUSE_KEYS=true $THIS_DIR/run-test-scenario.sh init-storage-and-distribution
+$THIS_DIR/run-test-scenario.sh init-storage-and-distribution
 
 # Start colossus & argus
 docker-compose -f $THIS_DIR/../../docker-compose.yml up -d colossus-1

+ 76 - 76
types/augment/all/types.ts

@@ -198,82 +198,6 @@ export interface Category extends Struct {
 /** @name CategoryId */
 export interface CategoryId extends u64 {}
 
-/** @name Channel */
-export interface Channel extends Struct {
-  readonly owner: ChannelOwner;
-  readonly num_videos: u64;
-  readonly is_censored: bool;
-  readonly reward_account: Option<GenericAccountId>;
-  readonly collaborators: BTreeSet<MemberId>;
-}
-
-/** @name ChannelCategory */
-export interface ChannelCategory extends Struct {}
-
-/** @name ChannelCategoryCreationParameters */
-export interface ChannelCategoryCreationParameters extends Struct {
-  readonly meta: Bytes;
-}
-
-/** @name ChannelCategoryId */
-export interface ChannelCategoryId extends u64 {}
-
-/** @name ChannelCategoryUpdateParameters */
-export interface ChannelCategoryUpdateParameters extends Struct {
-  readonly new_meta: Bytes;
-}
-
-/** @name ChannelCreationParameters */
-export interface ChannelCreationParameters extends Struct {
-  readonly assets: Option<StorageAssets>;
-  readonly meta: Option<Bytes>;
-  readonly reward_account: Option<GenericAccountId>;
-  readonly collaborators: BTreeSet<MemberId>;
-}
-
-/** @name ChannelId */
-export interface ChannelId extends u64 {}
-
-/** @name ChannelMigrationConfig */
-export interface ChannelMigrationConfig extends Struct {
-  readonly current_id: ChannelId;
-  readonly final_id: ChannelId;
-}
-
-/** @name ChannelOwner */
-export interface ChannelOwner extends Enum {
-  readonly isMember: boolean;
-  readonly asMember: MemberId;
-  readonly isCurators: boolean;
-  readonly asCurators: CuratorGroupId;
-}
-
-/** @name ChannelOwnershipTransferRequest */
-export interface ChannelOwnershipTransferRequest extends Struct {
-  readonly channel_id: ChannelId;
-  readonly new_owner: ChannelOwner;
-  readonly payment: u128;
-  readonly new_reward_account: Option<GenericAccountId>;
-}
-
-/** @name ChannelOwnershipTransferRequestId */
-export interface ChannelOwnershipTransferRequestId extends u64 {}
-
-/** @name ChannelUpdateParameters */
-export interface ChannelUpdateParameters extends Struct {
-  readonly assets_to_upload: Option<StorageAssets>;
-  readonly new_meta: Option<Bytes>;
-  readonly reward_account: Option<Option<GenericAccountId>>;
-  readonly assets_to_remove: BTreeSet<DataObjectId>;
-  readonly collaborators: Option<BTreeSet<MemberId>>;
-}
-
-/** @name ChildPositionInParentCategory */
-export interface ChildPositionInParentCategory extends Struct {
-  readonly parent_id: CategoryId;
-  readonly child_nr_in_parent_category: u32;
-}
-
 /** @name Cid */
 export interface Cid extends Bytes {}
 
@@ -508,6 +432,82 @@ export interface Finalized extends Struct {
 /** @name HiringApplicationId */
 export interface HiringApplicationId extends u64 {}
 
+/** @name Channel */
+export interface Channel extends Struct {
+  readonly owner: ChannelOwner;
+  readonly num_videos: u64;
+  readonly is_censored: bool;
+  readonly reward_account: Option<GenericAccountId>;
+  readonly collaborators: BTreeSet<MemberId>;
+}
+
+/** @name ChannelCategory */
+export interface ChannelCategory extends Struct {}
+
+/** @name ChannelCategoryCreationParameters */
+export interface ChannelCategoryCreationParameters extends Struct {
+  readonly meta: Bytes;
+}
+
+/** @name ChannelCategoryId */
+export interface ChannelCategoryId extends u64 {}
+
+/** @name ChannelCategoryUpdateParameters */
+export interface ChannelCategoryUpdateParameters extends Struct {
+  readonly new_meta: Bytes;
+}
+
+/** @name ChannelCreationParameters */
+export interface ChannelCreationParameters extends Struct {
+  readonly assets: Option<StorageAssets>;
+  readonly meta: Option<Bytes>;
+  readonly reward_account: Option<GenericAccountId>;
+  readonly collaborators: BTreeSet<MemberId>;
+}
+
+/** @name ChannelId */
+export interface ChannelId extends u64 {}
+
+/** @name ChannelMigrationConfig */
+export interface ChannelMigrationConfig extends Struct {
+  readonly current_id: ChannelId;
+  readonly final_id: ChannelId;
+}
+
+/** @name ChannelOwner */
+export interface ChannelOwner extends Enum {
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isCurators: boolean;
+  readonly asCurators: CuratorGroupId;
+}
+
+/** @name ChannelOwnershipTransferRequest */
+export interface ChannelOwnershipTransferRequest extends Struct {
+  readonly channel_id: ChannelId;
+  readonly new_owner: ChannelOwner;
+  readonly payment: u128;
+  readonly new_reward_account: Option<GenericAccountId>;
+}
+
+/** @name ChannelOwnershipTransferRequestId */
+export interface ChannelOwnershipTransferRequestId extends u64 {}
+
+/** @name ChannelUpdateParameters */
+export interface ChannelUpdateParameters extends Struct {
+  readonly assets_to_upload: Option<StorageAssets>;
+  readonly new_meta: Option<Bytes>;
+  readonly reward_account: Option<Option<GenericAccountId>>;
+  readonly assets_to_remove: BTreeSet<DataObjectId>;
+  readonly collaborators: Option<BTreeSet<MemberId>>;
+}
+
+/** @name ChildPositionInParentCategory */
+export interface ChildPositionInParentCategory extends Struct {
+  readonly parent_id: CategoryId;
+  readonly child_nr_in_parent_category: u32;
+}
+
 /** @name InactiveApplicationStage */
 export interface InactiveApplicationStage extends Struct {
   readonly deactivation_initiated: u32;

File diff suppressed because it is too large
+ 530 - 19
yarn.lock


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