From e2ed0851ded1e241247b30bf525c32b96aad1ebd Mon Sep 17 00:00:00 2001 From: rabi-siddique Date: Fri, 11 Oct 2024 14:08:01 +0500 Subject: [PATCH] chore: logging stdout and stderr --- .../specs/liquidation-reconstitution.spec.js | 10 ----- test/e2e/specs/liquidation.spec.js | 1 - test/e2e/support.js | 37 ++++++++++++++++--- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/test/e2e/specs/liquidation-reconstitution.spec.js b/test/e2e/specs/liquidation-reconstitution.spec.js index ed05781f..e06d0f64 100644 --- a/test/e2e/specs/liquidation-reconstitution.spec.js +++ b/test/e2e/specs/liquidation-reconstitution.spec.js @@ -413,16 +413,6 @@ describe('Wallet App Test Cases', () => { taskTimeout: DEFAULT_TASK_TIMEOUT, }, () => { - it('should create a vault minting 400 ISTs and giving 80 ATOMs as collateral', () => { - cy.skipWhen(AGORIC_NET !== networks.LOCAL); - - cy.createVault({ - wantMinted: 400, - giveCollateral: 80, - userKey: 'gov1', - }); - }); - it('should save bidder ATOM balance before placing bids', () => { cy.wait(QUICK_WAIT); cy.getTokenBalance({ diff --git a/test/e2e/specs/liquidation.spec.js b/test/e2e/specs/liquidation.spec.js index 4eca4fdf..0ee22e7b 100644 --- a/test/e2e/specs/liquidation.spec.js +++ b/test/e2e/specs/liquidation.spec.js @@ -786,7 +786,6 @@ describe('Wallet App Test Cases', () => { it('should cancel the 1IST bid', () => { cy.skipWhen(AGORIC_NET !== networks.LOCAL); - cy.reload(); cy.contains('Exit').click(); cy.wait(QUICK_WAIT); diff --git a/test/e2e/support.js b/test/e2e/support.js index f42f057d..0d11a290 100644 --- a/test/e2e/support.js +++ b/test/e2e/support.js @@ -15,7 +15,7 @@ const balanceUrl = : 'http://localhost:1317/cosmos/bank/v1beta1/balances/'; const COMMAND_TIMEOUT = configMap[network].COMMAND_TIMEOUT; -const agops = '/usr/src/agoric-sdk/packages/agoric-cli/bin/agops'; +const agops = 'agops'; Cypress.Commands.add('addKeys', params => { const { keyName, mnemonic, expectedAddress } = params; @@ -23,7 +23,12 @@ Cypress.Commands.add('addKeys', params => { cy.exec(command, { failOnNonZeroExit: false, - }).then(({ stdout }) => { + }).then(({ stdout, stderr }) => { + if (stderr && !stdout) { + cy.task('error', `STDERR: ${stderr}`); + throw Error(stderr); + } + cy.task('info', `STDOUT: ${stdout}`); expect(stdout).to.contain(expectedAddress); }); }); @@ -35,7 +40,12 @@ Cypress.Commands.add('setOraclePrice', price => { env: { AGORIC_NET }, timeout: COMMAND_TIMEOUT, }, - ).then(({ stdout }) => { + ).then(({ stdout, stderr }) => { + if (stderr && !stdout) { + cy.task('error', `STDERR: ${stderr}`); + throw Error(stderr); + } + cy.task('info', `STDOUT: ${stdout}`); expect(stdout).to.not.contain('Error'); expect(stdout).to.not.contain('error'); }); @@ -57,7 +67,12 @@ Cypress.Commands.add('createVault', params => { cy.exec(broadcastCommand, { env: { AGORIC_NET }, timeout: COMMAND_TIMEOUT, - }).then(({ stdout }) => { + }).then(({ stdout, stderr }) => { + if (stderr && !stdout) { + cy.task('error', `STDERR: ${stderr}`); + throw Error(stderr); + } + cy.task('info', `STDOUT: ${stdout}`); expect(stdout).not.to.contain('Error'); }); }); @@ -71,7 +86,12 @@ Cypress.Commands.add('placeBidByPrice', params => { env: { AGORIC_NET }, timeout: COMMAND_TIMEOUT, failOnNonZeroExit: false, - }).then(({ stdout }) => { + }).then(({ stdout, stderr }) => { + if (stderr && !stdout) { + cy.task('error', `STDERR: ${stderr}`); + throw Error(stderr); + } + cy.task('info', `STDOUT: ${stdout}`); expect(stdout).to.contain('Your bid has been accepted'); }); }); @@ -85,7 +105,12 @@ Cypress.Commands.add('placeBidByDiscount', params => { env: { AGORIC_NET }, timeout: COMMAND_TIMEOUT, failOnNonZeroExit: false, - }).then(({ stdout }) => { + }).then(({ stdout, stderr }) => { + if (stderr && !stdout) { + cy.task('error', `STDERR: ${stderr}`); + throw Error(stderr); + } + cy.task('info', `STDOUT: ${stdout}`); expect(stdout).to.contain('Your bid has been accepted'); }); });