-
Notifications
You must be signed in to change notification settings - Fork 207
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: tools for sync operations #10171
Conversation
cc @LuqiPan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like useful tools. Thanks for the PR.
There are a few code changes requested, but the rest are nits and typos.
a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js
Outdated
Show resolved
Hide resolved
a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js
Outdated
Show resolved
Hide resolved
a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js
Outdated
Show resolved
Hide resolved
57e25e6
to
0b1ace6
Compare
Thanks a lot for your comprehensive review. Implemented the changes you requested. @Chris-Hibbert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just discovered that the lint checking we have set up in our other repos isn't being applied here. Rather than pointing out individual deviations, I'm going to request that our SRE team add enforcement here.
Once that's in place, I'll ask for a clean-up pass, but it doesn't make sense to request thorough compliance until the tooling is in place.
I'll come back to this review once that has been configured.
Yep, I'm aware of that. But I thought this was something known. As In this case, other |
Not as I understand the process. I've filed a ticket, which should be fielded by our SRE team. They often are able to address simple issues like this overnight. |
* change `performAction.js` name to `submitBid.js` * remove `Math.round` from `scale6` * update indexing of bids and other constants in `config` object to improve readability (`auction.test.js`) * move helper functions in `auction.test.js` to `test-lib/auction-lib.js` * move `lib/vaults.mts` to `test-lib/vaults.mts` and remove empty `lib` directory * let it be known `sync-tools.js` is a stand-in code for Agoric#10171 Refs: Agoric/BytePitchPartnerEng#8
* change `performAction.js` name to `submitBid.js` * remove `Math.round` from `scale6` * update indexing of bids and other constants in `config` object to improve readability (`auction.test.js`) * move helper functions in `auction.test.js` to `test-lib/auction-lib.js` * move `lib/vaults.mts` to `test-lib/vaults.mts` and remove empty `lib` directory * let it be known `sync-tools.js` is a stand-in code for Agoric#10171 Refs: Agoric/BytePitchPartnerEng#8
…style fixes * change `performAction.js` name to `submitBid.js` * remove `Math.round` from `scale6` * update indexing of bids and other constants in `config` object to improve readability (`auction.test.js`) * move helper functions in `auction.test.js` to `test-lib/auction-lib.js` * move `lib/vaults.mts` to `test-lib/vaults.mts` and remove empty `lib` directory * let it be known `sync-tools.js` is a stand-in code for #10171 Refs: Agoric/BytePitchPartnerEng#8 fix: style fixes
0b1ace6
to
3db629b
Compare
closes: #10238 ## Description Lint a3p-integration for consistency and stopping red squiggles in IDEs Should unblock #10171 once it rebases on this ### Security Considerations n/a ### Scaling Considerations n/a ### Documentation Considerations The config should explain ### Testing Considerations per se ### Upgrade Considerations none
fd37b7c
to
3da0fa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the long delay.
No worries @Chris-Hibbert. Should I initiate the merge then? |
Refs: Agoric/BytePitchPartnerEng#10 fix: formatting fixes and change requests fix(sync-tools): apply new linting rules and fix rebase conflicts Refs: Agoric#10238
3da0fa5
to
dfd6be1
Compare
…style fixes * change `performAction.js` name to `submitBid.js` * remove `Math.round` from `scale6` * update indexing of bids and other constants in `config` object to improve readability (`auction.test.js`) * move helper functions in `auction.test.js` to `test-lib/auction-lib.js` * move `lib/vaults.mts` to `test-lib/vaults.mts` and remove empty `lib` directory * let it be known `sync-tools.js` is a stand-in code for Agoric#10171 Refs: Agoric/BytePitchPartnerEng#8 fix: style fixes
…st time related complexities fix: apply change requests from PR review, resolve rebase conflicts, style fixes * change `performAction.js` name to `submitBid.js` * remove `Math.round` from `scale6` * update indexing of bids and other constants in `config` object to improve readability (`auction.test.js`) * move helper functions in `auction.test.js` to `test-lib/auction-lib.js` * move `lib/vaults.mts` to `test-lib/vaults.mts` and remove empty `lib` directory * let it be known `sync-tools.js` is a stand-in code for #10171 Refs: Agoric/BytePitchPartnerEng#8 fix: style fixes fix(acceptance-auction): lint fixes
…ase (#10242) closes: https://github.com/Agoric/BytePitchPartnerEng/issues/12 refs: https://github.com/Agoric/BytePitchPartnerEng/issues/9 ## Description The existing test of the `KREAd` application on the `z:acceptance` test phase was limited to the feature allowing users to `mint` a new KREAd Character. This PR extends the existing test coverage to include the following cases: - minting a new Character - unequip all defaults Items - sell unequipped Item - buy an Item on marketplace - sell a Character - buy a Character on marketplace Along with the `kread.test.js` file, this PR includes a new file, `/test-lib/kread.js`, that provides all the required `helper functions` for the test cases above, allowing a cleaner and scalable design for KREAd tests. Since the test coverage of the new file overlaps with the existing one, I opted for removing both: - create-kread-item-test.sh - generate-kread-item-request.mjs ### Security Considerations No security considerations were identified. ### Scaling Considerations No scaling considerations were identified. ### Documentation Considerations No documentation considerations were identified. ### Testing Considerations I have confirmed that this works fine with existing a3p tests locally, there is still an improvement that may be useful to ensure that the user wallet's purse balance for the desired KREAd asset was updated accordingly. For this purpose, we intend to use one feature included in the currently open PR [#10171](#10171) , which is the sync-tools method `retryUntilCondition()`. However, we hope to address those changes in a different PR that will be the result of the effort put into the currently open [ticket](https://github.com/Agoric/BytePitchPartnerEng/issues/10)
refs: https://github.com/Agoric/BytePitchPartnerEng/issues/10
refs: Agoric/agoric-3-proposals#181
Description
Currently the way to make sure a transaction sent to agoric chain has been executed is to use a method from
@agoric/synthetic-chain
calledwaitForBlock
which stops the execution flow of a given ava test until N number of blocks are produced. This is not as deterministic as we'd like it to be but so far it worked fine. However, it could still end up in a race condition in some extreme cases. In this PR we introduce a set of tools to sync operations carried out in a test. Currently this PR supports operations like;See Agoric/agoric-3-proposals#181 for further discussion.
Security Considerations
This is merely a testing tool, so no security considerations.
Scaling Considerations
This is merely a testing tool, so no scaling considerations.
Documentation Considerations
If this ends up getting in to
@agoric/synthetic-chain
then we might need more extensive explanation of what we do. But for now, I don't think any documentation is needed.Testing Considerations
Have confirmed that this works fine with existing a3p tests locally but to keep the scope tighter I will update those tests one this PR lands. The coverage of the unit tests in
sync-tools.test.js
seems fine but I'm open to suggestions, of course.