Add debug logs
Some checks failed
Tests / sdk_tests (pull_request) Failing after 11s

This commit is contained in:
Prathamesh Musale 2024-01-17 17:06:23 +05:30
parent 972b878674
commit 0a99a1aea1
2 changed files with 27 additions and 6 deletions

View File

@ -17,12 +17,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Checkout laconicd - name: Checkout laconicd
uses: actions/checkout@v3 # uses: actions/checkout@v3
with: # with:
path: "./laconicd/" # path: "./laconicd/"
repository: cerc-io/laconicd # repository: cerc-io/laconicd
fetch-depth: 0 # fetch-depth: 0
ref: main # ref: main
run: |
git clone https://git.vdb.to/cerc-io/laconicd.git
cd laconicd
git checkout pm-qol-improvements
- name: Environment - name: Environment
run: ls -tlh && env run: ls -tlh && env

View File

@ -19,14 +19,20 @@ const namingTests = () => {
let watcherId: string; let watcherId: string;
beforeAll(async () => { beforeAll(async () => {
console.log('running parent beforeAll')
registry = new Registry(gqlEndpoint, restEndpoint, chainId); registry = new Registry(gqlEndpoint, restEndpoint, chainId);
console.log('registry fetched')
// Create bond. // Create bond.
bondId = await registry.getNextBondId(privateKey); bondId = await registry.getNextBondId(privateKey);
console.log('bondId', bondId)
await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
console.log('done creating bond')
// Create watcher. // Create watcher.
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
console.log('done ensureUpdatedConfig')
const result = await registry.setRecord( const result = await registry.setRecord(
{ {
privateKey, privateKey,
@ -38,6 +44,9 @@ const namingTests = () => {
) )
watcherId = result.data.id; watcherId = result.data.id;
console.log('watcherId', watcherId)
console.log('done running parent beforeAll')
}); });
describe('Authority tests', () => { describe('Authority tests', () => {
@ -45,6 +54,7 @@ const namingTests = () => {
const authorityName = `laconic-${Date.now()}`; const authorityName = `laconic-${Date.now()}`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee); await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
console.log('done Reserve authority')
}); });
describe('With authority reserved', () => { describe('With authority reserved', () => {
@ -52,10 +62,13 @@ const namingTests = () => {
let crn: string; let crn: string;
beforeAll(async () => { beforeAll(async () => {
console.log('running beforeAll')
authorityName = `laconic-${Date.now()}`; authorityName = `laconic-${Date.now()}`;
crn = `crn://${authorityName}/app/test`; crn = `crn://${authorityName}/app/test`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee); await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
console.log('done running beforeAll')
}) })
test('Lookup authority.', async () => { test('Lookup authority.', async () => {
@ -65,6 +78,7 @@ const namingTests = () => {
expect(record.ownerAddress).not.toBe(''); expect(record.ownerAddress).not.toBe('');
expect(record.ownerPublicKey).not.toBe(''); expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0); expect(Number(record.height)).toBeGreaterThan(0);
console.log('done Lookup authority')
}); });
test('Lookup non existing authority', async () => { test('Lookup non existing authority', async () => {
@ -73,11 +87,13 @@ const namingTests = () => {
expect(record.ownerAddress).toBe(''); expect(record.ownerAddress).toBe('');
expect(record.ownerPublicKey).toBe(''); expect(record.ownerPublicKey).toBe('');
expect(Number(record.height)).toBe(0); expect(Number(record.height)).toBe(0);
console.log('done Lookup non existing authority')
}); });
test('Reserve already reserved authority', async () => { test('Reserve already reserved authority', async () => {
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)). await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
rejects.toThrow('Name already reserved.'); rejects.toThrow('Name already reserved.');
console.log('done Reserve already reserved authority')
}); });
test('Reserve sub-authority.', async () => { test('Reserve sub-authority.', async () => {
@ -89,6 +105,7 @@ const namingTests = () => {
expect(record.ownerAddress).not.toBe(''); expect(record.ownerAddress).not.toBe('');
expect(record.ownerPublicKey).not.toBe(''); expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0); expect(Number(record.height)).toBeGreaterThan(0);
console.log('done Reserve sub-authority')
}); });
test('Reserve sub-authority with different owner.', async () => { test('Reserve sub-authority with different owner.', async () => {