Skip to content

Commit

Permalink
chore: logging stdout and stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Oct 11, 2024
1 parent 815c768 commit e2ed085
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
10 changes: 0 additions & 10 deletions test/e2e/specs/liquidation-reconstitution.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
1 change: 0 additions & 1 deletion test/e2e/specs/liquidation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
37 changes: 31 additions & 6 deletions test/e2e/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ 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;
const command = `echo ${mnemonic} | agd keys add ${keyName} --recover --keyring-backend=test`;

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);
});
});
Expand All @@ -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');
});
Expand All @@ -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');
});
});
Expand All @@ -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');
});
});
Expand All @@ -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');
});
});
Expand Down

0 comments on commit e2ed085

Please sign in to comment.