Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add missing test cases for bids #159

Closed

Conversation

rabi-siddique
Copy link
Contributor

@rabi-siddique rabi-siddique commented Apr 19, 2024

The PR adds tests for:

  • Viewing bids from the CLI.
  • Changing price from the CLI.

@rabi-siddique rabi-siddique self-assigned this Apr 19, 2024
@rabi-siddique rabi-siddique marked this pull request as draft April 19, 2024 17:05
@rabi-siddique rabi-siddique force-pushed the rs-additional-cli-tests branch 2 times, most recently from 210ae8a to bbf89d3 Compare April 20, 2024 06:19
@rabi-siddique
Copy link
Contributor Author

rabi-siddique commented Apr 20, 2024

The tests related to viewing bids are currently failing due to a known issue. This issue is being tracked in the following pull request: Agoric/agoric-sdk#9024. I will proceed with this PR once the related issue is resolved.

@rabi-siddique
Copy link
Contributor Author

The test that involves changing prices using the agops oracle command requires the use of governance wallets. The appropriateness of using these addresses for end-to-end testing is currently under discussion. At the moment, I am using governance wallet addresses from the local chain which leads to test failing with emerynet.

@rabi-siddique rabi-siddique linked an issue Apr 20, 2024 that may be closed by this pull request
@rabi-siddique rabi-siddique force-pushed the rs-additional-cli-tests branch from bbf89d3 to 4ea85ba Compare April 20, 2024 17:06
@@ -3,5 +3,5 @@

source ./test/e2e/test-scripts/common.sh

agops inter bid by-discount --discount 5 --give 2IST --from $accountAddress --keyring-backend=test 2>&1
agops inter bid by-discount --discount 5 --give 2IST --from $user2Address --keyring-backend=test 2>&1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2>&1 doesn't seem appropriate here - inter bid sends data (in JSON) to stdout and misc. progress info to stderr.

Oh... but I don't see anything consuming any of the output. So maybe it doesn't matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah. I see the .js code consumes the output.

@@ -57,6 +57,15 @@ describe('Wallet App Test Cases', () => {
});
});

it('should view the bid from CLI', () => {
cy.exec('bash ./test/e2e/test-scripts/view-bids.sh', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view-bids.sh is essentially a 1 liner. How about just inlining it into the .js code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's do that. I need to combine some variables from common.sh with the command in view-bids.sh. Should we prioritize consistency since we're using .sh files in other shell-based tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I was running the test for view.bids.sh. And it tends to give the same issue solved here:
Agoric/agoric-sdk#9024

But if I run the agops inter bid list from the shell, all works as expected. I reckon we're some using old dependencies in the wallet-app?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we prioritize consistency since we're using .sh files in other shell-based tests?

I prefer to review as little .sh code as possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if I run the agops inter bid list from the shell, all works as expected. I reckon we're some using old dependencies in the wallet-app?

I'm still trying to figure out why we're testing the bidding CLI code from agoric-sdk in the wallet-app repo at all.

But yes, we seem to be getting agoric-sdk (including the bidding CLI) from a published docker image for agoric-sdk... I suppose that's from a recent release.

https://github.com/Agoric/wallet-app/blob/8188ec6fb66c61bb43db9d1f57089487df70050b/Dockerfile#L1C1-L1C38

agoric-sdk:latest ... looks like it's currently 20240420012145-734e86 aka agoric-upgrade-15-rc0 Apr 20.

The fix, 9024 wasn't merged until Apr 22.

The instructions for bidding don't say to use code from such a release. They say to do:

git clone https://github.com/Agoric/agoric-sdk
cd agoric-sdk
SKIP_DOWNLOAD=false ./bin/agd build
export PATH=$PWD/bin:$PATH
alias inter="yarn run --silent agops inter"
export AGORIC_NET=main

Installing straight from master is a little goofy (long story... agops is a test tool but we're using it as an end-user tool... cc @otoole-brendan ), but until we decide to do otherwise, I suppose we should do that in ci.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bids placed from the CLI have an element of UI testing as well. Once a bid is placed from the CLI, it is visible on the wallet-app UI.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I was installing directly from the master and it was goofy :D
It also involved setting node and Golang in CI. The CI test runs took more than 15 minutes till I found agoric-sdk image.

Copy link
Contributor Author

@rabi-siddique rabi-siddique Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to review as little .sh code as possible.

I'm working on eliminating bash scripts from liquidation tests, in this pull request. I'm also planning to apply a similar approach to the bid-related tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I was installing directly from the master and it was goofy :D It also involved setting node and Golang in CI. The CI test runs took more than 15 minutes till I found agoric-sdk image.

Really? ci in the docs repo installs agoric-sdk from source and it runs in under 4min:
https://github.com/Agoric/documentation/actions/runs/8707389744/job/23882252835

I'm not sure what to tell you... if we want to test the product that we tell users to use for bidding, that's not the agoric-sdk image.

@rabi-siddique rabi-siddique force-pushed the rs-additional-cli-tests branch from 0237bae to 9c70872 Compare April 23, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bidding E2E Testing Completed
2 participants