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

Refine PoX-4 stateful testing environment and address comments #4597

Conversation

BowTiedRadone
Copy link
Contributor

This PR refines the PoX-4 stateful property testing environment and addresses all the comments. It is part of #4548 and targets feat/pox-4-stateful-property-testing (#4550).

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.09%. Comparing base (e21db00) to head (24d4560).

Additional details and impacted files
@@                           Coverage Diff                            @@
##           feat/pox-4-stateful-property-testing    #4597      +/-   ##
========================================================================
- Coverage                                 83.33%   83.09%   -0.25%     
========================================================================
  Files                                       470      470              
  Lines                                    332151   332151              
  Branches                                    317      317              
========================================================================
- Hits                                     276799   276000     -799     
- Misses                                    55344    56143     +799     
  Partials                                      8        8              

see 33 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e21db00...24d4560. Read the comment docs.

Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Looks great! I left a few notes that should be easy to address.

@@ -90,7 +90,8 @@ export class DelegateStackStxCommand implements PoxCommand {
stackerWallet.delegatedMaxAmount >= Number(this.amountUstx) &&
Number(this.amountUstx) <= stackerWallet.ustxBalance &&
Number(this.amountUstx) >= model.stackingMinimum &&
operatorWallet.hasPoolMembers.includes(stackerWallet.stxAddress) &&
operatorWallet.poolMembers.length > 0 &&
Copy link
Member

Choose a reason for hiding this comment

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

If length is 0 what happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It means no delegator has delegated the operator, so the command should fail.

Copy link
Member

Choose a reason for hiding this comment

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

If I remove this and set numRuns to 100 nothing fails though.

BowTiedRadone and others added 10 commits March 29, 2024 13:48
Thanks to @hugocaillard for swiftly implementing this feature.
Co-authored-by: Nikos Baxevanis <nikos.baxevanis@gmail.com>
Removed the "./noopReporter.ts" from the global Vitest reporters
configuration to ensure test outputs are visible by default. This change
addresses an issue where the output from all tests was being hidden,
making it difficult to observe test results directly. The noopReporter
can still be used selectively for specific tests via:
npx vitest --reporter=./noopReporter.ts run tests/pox-4/pox-4.stateful-prop.test.ts
Each `run` method now calls `model.trackCommandRun(this.constructor.name)`,
enhancing observability and aiding in debugging by systematically tracking
command executions.

Example output:

    Command run method execution counts:
    AllowContractCallerCommand: 491
    DelegateStackStxCommand: 1
    DelegateStxCommand: 285
    GetStackingMinimumCommand: 536
    GetStxAccountCommand: 503
    RevokeDelegateStxCommand: 281
    StackStxCommand: 8
@moodmosaic moodmosaic force-pushed the feat/pox-4-stateful-testing-refine branch from 24d4560 to beb9a04 Compare March 29, 2024 12:51
@moodmosaic
Copy link
Member

Merging into feat/pox-4-stateful-property-testing.

@moodmosaic moodmosaic merged commit 990512d into feat/pox-4-stateful-property-testing Mar 29, 2024
1 check passed
@moodmosaic moodmosaic deleted the feat/pox-4-stateful-testing-refine branch March 29, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants