-
Notifications
You must be signed in to change notification settings - Fork 123
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
API Test Coverage #1203
Comments
API docs ares here: https://docs.hiro.so/api |
Use Case(s) redefined:
*Mempool has been moved as Use Case # 1 (based on @rafaelcr 's input)
https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/mempool Scenario 1: Possible scenario with any type of anchor mode and post condition which has the tx in mempool tx Scenario 2: Possible scenario to verify all transactions to have a status of _pending_are in the MEMPOOL Scenario 3: Possible test if the total tx returned is growing than the initial round of API call In this case ,for an example, total was 100 on the first API call but grows as time of the day extends to 108 Scenario 4: Tx number in mempool also drops as tx gets confirmed in anchor block/ microblock Scenario 5: Possible test if all the tx in mempool is indicating pending n its tx _status Scenario 6: Possible test what is the acceptable limit of tx which can be in pending status ( to monitor if there is >400 tx for instance we can raise the alert to deep dive the blockage)
https://stacks-node-api.mainnet.stacks.co//extended/v1/microblock/unanchored/txs Testing the ?unanchored param is working correctly during the window of time where a tx is only in a microblock Scenario 1: Possible scenarios based on the block information in the explorer, there could be a particular window of time where there is no microblock transaction but all transactions confirmed in the anchor block. Thus querying the API above will return API results =0 yet it's a valid test as it's an accurate result. Scenario 2 : Possible scenario when the parameter complies to the below especially with anchor_mode is only microblock or only anchor block (need input on ='only microblock"??) This will return all results of tx which are unanchored given a particular time. Scenario 3: Possible scenario with particular parameters as below: Additional test WIP |
Possible edge case(s) which needs to be considered when building the API test:
|
The scenarios above are divided into smaller sections for ease of API individual test which will cover all the necessary coverage |
Tech Stack:Visual Code,Thunder Client and Postman Test Status
Test Findings
The conditioned use case above is able to be monitored manually but when it's automated, the results can be returned as " Test Next Step
Note: Am running couple test as we speak and will update the ticket along with it |
Manual POX was approved and presented. |
@Eshwari007 would you mind publishing the code on Github. The most effective way to review code and give feedback is by sharing it. You can open a PR, even if it's a WIP PR, for review. What do you mean by "Manual POX was approved"? |
My bad-meant 'POC' ,accidentally typed POX. GitHub repo: Next Steps:
Do ping if any name tweaks are needed, currently have the permissions set as Public but can limit it to team setting as well. |
Scheduled a call tomorrow with @CharlieC3 on ways to implement the next steps esp, importing all tests on GitHub actions. |
The objective below was provided by @andresgalante to outline the start of API automation for the below.
The goal is to bring test coverage up to 80% in these scenarios:
Use Case #1:
Testing the ?unanchored param is working correctly during the window of time where a tx is only in a microblock
Scenarios:
https://stacks-node-api.mainnet.stacks.co//extended/v1/microblock/unanchored/txs
1- Possible scenarios based on the block information in the explorer, there could be a particular window of time where there is no microblock transaction but all transactions confirmed in the anchor block. Thus querying the API above will return API results =0 yet it's a valid test as it's an accurate result.
"anchor_mode": "any",
"is_unanchored": true,
"microblock_canonical": true,
This will return all results of tx which are unanchored given a particular time.
burn_block_time":
"parent_burn_block_time":
There are two
time
parameters which I assume would be the potential window of time, would like to identify the valid one for the objective.Use Case #2: Similar to Mempool tx
https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/mempool
"anchor_mode": "any","tx_status": "pending",
Possible scenario to verify all transactions to have a status of _pending_are in the MEMPOOL
Possible test if the total tx returned is growing than the initial round of API call
"total": 108,
"results": [}
In this case ,for an example, total was 100 on the first API call but grows as time of the day extends to 108
Possible test if all the tx in mempool is indicating pending n its tx _status
Possible test what is the acceptable limit of tx which can be in pending status ( to monitor if there is >400 tx for instance we can raise the alert to deep dive the blockage)
Use Case #3: Handle block and microblock reorgs for /extended/v1/:address/transactions path
This use case is a little vague for me as am not quite sure if the query is for blocks based on block height for particular addresses in an account
Will this use case be utilizing the following API,e.g:`https://stacks-node-api.mainnet.stacks.co/extended/v1/address/SP17YZQB1228EK9MPHQXA8GC4G3HVWZ66X7VRPMAX/mempool?
Will these parameters be vital for use case 3?
"block_height":
"block_hash":
"microblock_hash":
"microblock_sequence
I would like to discuss the details with @rafaelcr and @zone117x and get the API team's priority on what they need to test around as well as their order for the 80% use case coverage. Let's set up a call to document the expected results and the definition of 'Done' for this API testing goal to guarantee we cover all potential scenarios.
Last but not least, is there any API documentation that can be of good use to me?
Note:
I have worked with the first two use case(s) when they were introduced along with web wallet testing but for the third use case would need some extra inputs in order to deep dive into the needs of the testing.
Other questions:
Environment specific
-Stacks node version?
-Stacks API client version?
cc:@hirosystems/ux-team I will be working on the above for API automation.
The text was updated successfully, but these errors were encountered: