From 0a99a1aea1350e5dd0d70966d397e0887b0c6571 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 17 Jan 2024 17:06:23 +0530 Subject: [PATCH] Add debug logs --- .gitea/workflows/test.yml | 16 ++++++++++------ src/naming.test.ts | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 41942df..feed158 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -17,12 +17,16 @@ jobs: steps: - uses: actions/checkout@v3 - name: Checkout laconicd - uses: actions/checkout@v3 - with: - path: "./laconicd/" - repository: cerc-io/laconicd - fetch-depth: 0 - ref: main + # uses: actions/checkout@v3 + # with: + # path: "./laconicd/" + # repository: cerc-io/laconicd + # fetch-depth: 0 + # ref: main + run: | + git clone https://git.vdb.to/cerc-io/laconicd.git + cd laconicd + git checkout pm-qol-improvements - name: Environment run: ls -tlh && env diff --git a/src/naming.test.ts b/src/naming.test.ts index 9d82c3d..2f7dc39 100644 --- a/src/naming.test.ts +++ b/src/naming.test.ts @@ -19,14 +19,20 @@ const namingTests = () => { let watcherId: string; beforeAll(async () => { + console.log('running parent beforeAll') + registry = new Registry(gqlEndpoint, restEndpoint, chainId); + console.log('registry fetched') // Create bond. bondId = await registry.getNextBondId(privateKey); + console.log('bondId', bondId) await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee); + console.log('done creating bond') // Create watcher. watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); + console.log('done ensureUpdatedConfig') const result = await registry.setRecord( { privateKey, @@ -38,6 +44,9 @@ const namingTests = () => { ) watcherId = result.data.id; + console.log('watcherId', watcherId) + + console.log('done running parent beforeAll') }); describe('Authority tests', () => { @@ -45,6 +54,7 @@ const namingTests = () => { const authorityName = `laconic-${Date.now()}`; await registry.reserveAuthority({ name: authorityName }, privateKey, fee); + console.log('done Reserve authority') }); describe('With authority reserved', () => { @@ -52,10 +62,13 @@ const namingTests = () => { let crn: string; beforeAll(async () => { + console.log('running beforeAll') + authorityName = `laconic-${Date.now()}`; crn = `crn://${authorityName}/app/test`; await registry.reserveAuthority({ name: authorityName }, privateKey, fee); + console.log('done running beforeAll') }) test('Lookup authority.', async () => { @@ -65,6 +78,7 @@ const namingTests = () => { expect(record.ownerAddress).not.toBe(''); expect(record.ownerPublicKey).not.toBe(''); expect(Number(record.height)).toBeGreaterThan(0); + console.log('done Lookup authority') }); test('Lookup non existing authority', async () => { @@ -73,11 +87,13 @@ const namingTests = () => { expect(record.ownerAddress).toBe(''); expect(record.ownerPublicKey).toBe(''); expect(Number(record.height)).toBe(0); + console.log('done Lookup non existing authority') }); test('Reserve already reserved authority', async () => { await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)). rejects.toThrow('Name already reserved.'); + console.log('done Reserve already reserved authority') }); test('Reserve sub-authority.', async () => { @@ -89,6 +105,7 @@ const namingTests = () => { expect(record.ownerAddress).not.toBe(''); expect(record.ownerPublicKey).not.toBe(''); expect(Number(record.height)).toBeGreaterThan(0); + console.log('done Reserve sub-authority') }); test('Reserve sub-authority with different owner.', async () => {