Przeglądaj źródła

integration-tests: show only tests debug logs

Mokhtar Naamani 4 lat temu
rodzic
commit
62c15bad09
25 zmienionych plików z 31 dodań i 28 usunięć
  1. 1 1
      tests/network-tests/run-test-scenario.sh
  2. 1 1
      tests/network-tests/src/Job.ts
  3. 1 1
      tests/network-tests/src/Resources.ts
  4. 1 1
      tests/network-tests/src/Scenario.ts
  5. 1 1
      tests/network-tests/src/fixtures/membershipModule.ts
  6. 4 2
      tests/network-tests/src/fixtures/proposalsModule.ts
  7. 1 1
      tests/network-tests/src/flows/contentDirectory/contentDirectoryInitialization.ts
  8. 1 1
      tests/network-tests/src/flows/contentDirectory/creatingChannel.ts
  9. 1 1
      tests/network-tests/src/flows/contentDirectory/creatingVideo.ts
  10. 1 1
      tests/network-tests/src/flows/contentDirectory/updatingChannel.ts
  11. 1 1
      tests/network-tests/src/flows/council/setup.ts
  12. 1 1
      tests/network-tests/src/flows/membership/creatingMemberships.ts
  13. 4 3
      tests/network-tests/src/flows/proposals/electionParametersProposal.ts
  14. 1 1
      tests/network-tests/src/flows/proposals/manageLeaderRole.ts
  15. 1 1
      tests/network-tests/src/flows/proposals/spendingProposal.ts
  16. 1 1
      tests/network-tests/src/flows/proposals/textProposal.ts
  17. 1 1
      tests/network-tests/src/flows/proposals/updateRuntime.ts
  18. 1 1
      tests/network-tests/src/flows/proposals/validatorCountProposal.ts
  19. 1 1
      tests/network-tests/src/flows/storageNode/getContentFromStorageNode.ts
  20. 1 1
      tests/network-tests/src/flows/workingGroup/atLeastValueBug.ts
  21. 1 1
      tests/network-tests/src/flows/workingGroup/leaderSetup.ts
  22. 1 1
      tests/network-tests/src/flows/workingGroup/manageWorkerAsLead.ts
  23. 1 1
      tests/network-tests/src/flows/workingGroup/manageWorkerAsWorker.ts
  24. 1 1
      tests/network-tests/src/flows/workingGroup/workerPayout.ts
  25. 1 1
      tests/network-tests/src/sender.ts

+ 1 - 1
tests/network-tests/run-test-scenario.sh

@@ -10,4 +10,4 @@ SCENARIO=$1
 SCENARIO=${SCENARIO:=full}
 
 # Execute the tests
-time DEBUG=* yarn workspace network-tests node-ts-strict src/scenarios/${SCENARIO}.ts
+time DEBUG=integration-tests* yarn workspace network-tests node-ts-strict src/scenarios/${SCENARIO}.ts

+ 1 - 1
tests/network-tests/src/Job.ts

@@ -30,7 +30,7 @@ export class Job {
     this._flows = flows
     this._outcome = new InvertedPromise<JobOutcome>()
     this._manager.on('run', this.run.bind(this))
-    this.debug = Debugger(`job:${this._label}`)
+    this.debug = Debugger(`integration-tests:job:${this._label}`)
   }
 
   // Depend on another job to complete successfully

+ 1 - 1
tests/network-tests/src/Resources.ts

@@ -2,7 +2,7 @@ import { assert } from 'chai'
 import { Utils } from './utils'
 import Debugger from 'debug'
 
-const debug = Debugger('resources')
+const debug = Debugger('integration-tests:resources')
 
 type NamedLocks = Record<Resource, Lock>
 export type ResourceLocker = (resource: Resource, timeout?: number) => Promise<() => void>

+ 1 - 1
tests/network-tests/src/Scenario.ts

@@ -41,7 +41,7 @@ export async function scenario(scene: (props: ScenarioProps) => Promise<void>):
 
   const query = new QueryNodeApi(queryNodeProvider)
 
-  const debug = Debugger('scenario')
+  const debug = Debugger('integration-tests:scenario')
 
   const jobs = new JobManager({ apiFactory, query, env })
 

+ 1 - 1
tests/network-tests/src/fixtures/membershipModule.ts

@@ -15,7 +15,7 @@ export class BuyMembershipHappyCaseFixture extends BaseFixture {
     super(api)
     this.accounts = accounts
     this.paidTerms = paidTerms
-    this.debug = Debugger('fixture:BuyMembershipHappyCaseFixture')
+    this.debug = Debugger('integration-tests:fixture:BuyMembershipHappyCaseFixture')
   }
 
   public getCreatedMembers(): MemberId[] {

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

@@ -471,11 +471,13 @@ export class ElectionParametersProposalFixture extends BaseFixture {
       proposedMinCouncilStake,
       proposedMinVotingStake
     )
+
     const proposalNumber = this.api.findProposalCreatedEvent(proposalCreationResult.events) as ProposalId
     assert.notEqual(proposalNumber, undefined)
 
     const approveProposalFixture = new VoteForProposalFixture(this.api, proposalNumber)
     await approveProposalFixture.execute()
+
     assert(approveProposalFixture.proposalExecuted)
 
     // Assertions
@@ -733,10 +735,10 @@ export class VoteForProposalFixture extends BaseFixture {
     this.api.treasuryTransferBalanceToAccounts(councilAccounts, proposalVoteFee)
 
     // Approving the proposal
-    const onProposalFinalized = this.api.waitForProposalToFinalize(this.proposalNumber)
+    const onProposalFinalized = await this.api.waitForProposalToFinalize(this.proposalNumber)
     const approvals = await this.api.batchApproveProposal(this.proposalNumber)
     approvals.map((result) => this.expectDispatchSuccess(result, 'Proposal Approval Vote Expected To Be Successful'))
-    const proposalOutcome = await onProposalFinalized
+    const proposalOutcome = await onProposalFinalized.promise
     this._proposalExecuted = proposalOutcome[0]
     this._events = proposalOutcome[1]
   }

+ 1 - 1
tests/network-tests/src/flows/contentDirectory/contentDirectoryInitialization.ts

@@ -1,6 +1,6 @@
 import { FlowProps } from '../../Flow'
 import Debugger from 'debug'
-const debug = Debugger('initializeContentDirectory')
+const debug = Debugger('integration-tests:initializeContentDirectory')
 
 export default async function initializeContentDirectory({ api }: FlowProps): Promise<void> {
   debug('Started')

+ 1 - 1
tests/network-tests/src/flows/contentDirectory/creatingChannel.ts

@@ -31,7 +31,7 @@ function assertChannelMatchQueriedResult(queriedChannel: any, channel: ChannelEn
 }
 
 export default async function channelCreation({ api, query }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:creatingChannel')
+  const debug = Debugger('integration-tests:flow:creatingChannel')
   debug('Started')
 
   const createChannelHappyCaseFixture = createSimpleChannelFixture(api)

+ 1 - 1
tests/network-tests/src/flows/contentDirectory/creatingVideo.ts

@@ -56,7 +56,7 @@ function assertVideoMatchQueriedResult(queriedVideo: any, video: VideoEntity) {
 }
 
 export default async function createVideo({ api, query }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:creatingVideo')
+  const debug = Debugger('integration-tests:flow:creatingVideo')
   debug('Started')
 
   const channelTitle = 'New channel example'

+ 1 - 1
tests/network-tests/src/flows/contentDirectory/updatingChannel.ts

@@ -19,7 +19,7 @@ export function createUpdateChannelHandleFixture(api: Api, handle: string, descr
 }
 
 export default async function updateChannel({ api, query }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:updateChannel')
+  const debug = Debugger('integration-tests:flow:updateChannel')
   debug('Started')
 
   const handle = 'New channel example'

+ 1 - 1
tests/network-tests/src/flows/council/setup.ts

@@ -9,7 +9,7 @@ import { Resource } from '../../Resources'
 
 export default async function councilSetup({ api, env, lock }: FlowProps): Promise<void> {
   const label = 'councilSetup'
-  const debug = Debugger(`flow:${label}`)
+  const debug = Debugger(`integration-tests:flow:${label}`)
 
   debug('Started')
 

+ 1 - 1
tests/network-tests/src/flows/membership/creatingMemberships.ts

@@ -10,7 +10,7 @@ import { FixtureRunner } from '../../Fixture'
 import { assert } from 'chai'
 
 export default async function membershipCreation({ api, env }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:memberships')
+  const debug = Debugger('integration-tests:flow:memberships')
   debug('Started')
   api.enableDebugTxLogs()
 

+ 4 - 3
tests/network-tests/src/flows/proposals/electionParametersProposal.ts

@@ -7,17 +7,18 @@ import { Resource } from '../../Resources'
 
 // Election parameters proposal scenario
 export default async function electionParametersProposal({ api, lock }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:electionParametersProposal')
+  const debug = Debugger('integration-tests:flow:electionParametersProposal')
   debug('Started')
   await lock(Resource.Proposals)
-
+  debug('lock acquired contining flow')
   // Pre-Conditions: some members and an elected council
   const council = await api.getCouncil()
   assert.notEqual(council.length, 0)
-
+  debug('selected proposer')
   const proposer = council[0].member.toString()
 
   const electionParametersProposalFixture = new ElectionParametersProposalFixture(api, proposer)
+  debug('created fixture, running it')
   await new FixtureRunner(electionParametersProposalFixture).run()
 
   debug('Done')

+ 1 - 1
tests/network-tests/src/flows/proposals/manageLeaderRole.ts

@@ -32,7 +32,7 @@ export default {
 }
 
 async function manageLeaderRole(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups, lock: ResourceLocker) {
-  const debug = Debugger(`flow:managerLeaderRole:${group}`)
+  const debug = Debugger(`integration-tests:flow:managerLeaderRole:${group}`)
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/flows/proposals/spendingProposal.ts

@@ -7,7 +7,7 @@ import Debugger from 'debug'
 import { Resource } from '../../Resources'
 
 export default async function spendingProposal({ api, env, lock }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:spendingProposals')
+  const debug = Debugger('integration-tests:flow:spendingProposals')
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/flows/proposals/textProposal.ts

@@ -6,7 +6,7 @@ import Debugger from 'debug'
 import { Resource } from '../../Resources'
 
 export default async function textProposal({ api, lock }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:textProposal')
+  const debug = Debugger('integration-tests:flow:textProposal')
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/flows/proposals/updateRuntime.ts

@@ -9,7 +9,7 @@ import Debugger from 'debug'
 import { Resource } from '../../Resources'
 
 export default async function updateRuntime({ api, env, lock }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:updateRuntime')
+  const debug = Debugger('integration-tests:flow:updateRuntime')
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/flows/proposals/validatorCountProposal.ts

@@ -7,7 +7,7 @@ import Debugger from 'debug'
 import { Resource } from '../../Resources'
 
 export default async function validatorCount({ api, lock }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:validatorCountProposal')
+  const debug = Debugger('integration-tests:flow:validatorCountProposal')
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/flows/storageNode/getContentFromStorageNode.ts

@@ -8,7 +8,7 @@ import { Utils } from '../../utils'
 import Debugger from 'debug'
 
 export default async function getContentFromStorageNode({ api, query }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:getContentFromStorageNode')
+  const debug = Debugger('integration-tests:flow:getContentFromStorageNode')
   debug('Started')
 
   const videoTitle = 'Storage node test'

+ 1 - 1
tests/network-tests/src/flows/workingGroup/atLeastValueBug.ts

@@ -8,7 +8,7 @@ import { FixtureRunner } from '../../Fixture'
 
 // Zero at least value bug scenario
 export default async function zeroAtLeastValueBug({ api, env }: FlowProps): Promise<void> {
-  const debug = Debugger('flow:atLeastValueBug')
+  const debug = Debugger('integration-tests:flow:atLeastValueBug')
   debug('Started')
   api.enableDebugTxLogs()
 

+ 1 - 1
tests/network-tests/src/flows/workingGroup/leaderSetup.ts

@@ -19,7 +19,7 @@ export default {
 
 // Worker application happy case scenario
 async function leaderSetup(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups): Promise<void> {
-  const debug = Debugger(`flow:leaderSetup:${group}`)
+  const debug = Debugger(`integration-tests:flow:leaderSetup:${group}`)
   debug('Started')
 
   const existingLead = await api.getGroupLead(group)

+ 1 - 1
tests/network-tests/src/flows/workingGroup/manageWorkerAsLead.ts

@@ -26,7 +26,7 @@ export default {
 }
 
 async function manageWorkerAsLead(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups): Promise<void> {
-  const debug = Debugger(`flow:manageWorkerAsLead:${group}`)
+  const debug = Debugger(`integration-tests:flow:manageWorkerAsLead:${group}`)
   debug('Started')
 
   const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)

+ 1 - 1
tests/network-tests/src/flows/workingGroup/manageWorkerAsWorker.ts

@@ -26,7 +26,7 @@ export default {
 
 // Manage worker as worker
 async function manageWorkerAsWorker(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups) {
-  const debug = Debugger(`flow:manageWorkerAsWorker:${group}`)
+  const debug = Debugger(`integration-tests:flow:manageWorkerAsWorker:${group}`)
   debug('Started')
 
   const applicationStake: BN = new BN(env.WORKING_GROUP_APPLICATION_STAKE!)

+ 1 - 1
tests/network-tests/src/flows/workingGroup/workerPayout.ts

@@ -28,7 +28,7 @@ export default {
 }
 
 async function workerPayouts(api: Api, env: NodeJS.ProcessEnv, group: WorkingGroups, lock: ResourceLocker) {
-  const debug = Debugger(`flow:workerPayout:${group}`)
+  const debug = Debugger(`integration-tests:flow:workerPayout:${group}`)
   debug('Started')
   await lock(Resource.Proposals)
 

+ 1 - 1
tests/network-tests/src/sender.ts

@@ -26,7 +26,7 @@ export class Sender {
   constructor(api: ApiPromise, keyring: Keyring, label: string) {
     this.api = api
     this.keyring = keyring
-    this.debug = Debugger(`Sender:${Sender.instance++}:${label}`)
+    this.debug = Debugger(`integration-tests:sender:${Sender.instance++}:${label}`)
   }
 
   // Synchronize all sending of transactions into mempool, so we can always safely read