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

Integrated/Scenario Tests In Rust #4586

Merged
merged 39 commits into from
Apr 18, 2024
Merged

Integrated/Scenario Tests In Rust #4586

merged 39 commits into from
Apr 18, 2024

Conversation

setzeus
Copy link
Collaborator

@setzeus setzeus commented Mar 25, 2024

Description

Out of draft & ready for review, this PR implements & addresses all five scenarios laid out in issue #4554. The scenarios test multiple users & span for multiple reward cycles with the goal of the tests cross through all three boot Clarity contracts [pox-4/signers/signers-voting].

Applicable issues

Additional info (benefits, drawbacks, caveats)

Also slightly updates an error message found in pox-4 to make signer authorizations fail more clearly. Can likely refactor & extract out a few common setup functions but logic is ready for review.

@jferrant jferrant force-pushed the chore/rust-scenario-test branch 4 times, most recently from f7370f9 to f2e6c05 Compare March 25, 2024 22:32
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 89.77273% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 61.45%. Comparing base (132ced0) to head (7dfe1bb).
Report is 5 commits behind head on next.

Additional details and impacted files
@@             Coverage Diff             @@
##             next    #4586       +/-   ##
===========================================
- Coverage   77.78%   61.45%   -16.33%     
===========================================
  Files         470      470               
  Lines      332564   335114     +2550     
  Branches      317      317               
===========================================
- Hits       258690   205955    -52735     
- Misses      73866   129151    +55285     
  Partials        8        8               
Files Coverage Δ
...kslib/src/chainstate/nakamoto/coordinator/tests.rs 81.70% <ø> (-18.08%) ⬇️
stackslib/src/chainstate/nakamoto/signer_set.rs 82.20% <100.00%> (+0.04%) ⬆️
...tackslib/src/chainstate/stacks/boot/pox_4_tests.rs 52.81% <ø> (-32.40%) ⬇️
...ckslib/src/chainstate/stacks/boot/signers_tests.rs 56.37% <100.00%> (-32.64%) ⬇️
...src/chainstate/stacks/boot/signers_voting_tests.rs 60.40% <50.00%> (-20.88%) ⬇️
stackslib/src/net/relay.rs 32.71% <0.00%> (-18.49%) ⬇️
stackslib/src/chainstate/stacks/boot/mod.rs 73.00% <93.82%> (-7.64%) ⬇️

... and 309 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 132ced0...7dfe1bb. Read the comment docs.

@setzeus setzeus marked this pull request as ready for review April 1, 2024 14:44
@setzeus setzeus changed the title [DRAFT] Integrated/Scenario Tests In Rust Integrated/Scenario Tests In Rust Apr 1, 2024
.stacker_dbs
.push(boot_code_id(MINERS_NAME, false));
peer_config.epochs = Some(StacksEpoch::unit_test_3_0_only(1000)); // Let us not activate nakamoto to make life easier
peer_config.initial_balances = vec![(addr.to_account_principal(), 1_000_000_000_000_000_000)];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think 1_000_000_000_000_000_000 is the same as default_initial_balance so would prob just use that here as well.

Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

This looks good to me.

There's just two changes that are needed:

  1. Please remove the logging changes / printlns outside of the test modules.
  2. Can this be rebased and retargeted against develop?

@setzeus setzeus changed the base branch from next to develop April 11, 2024 01:31
jferrant
jferrant previously approved these changes Apr 15, 2024
hstove
hstove previously approved these changes Apr 16, 2024
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

Bravo on this. Excellent code quality, I appreciate all the detail you used to describe tests, variable names, helper functions, etc.

@setzeus setzeus dismissed stale reviews from jferrant and hstove via 9b51ccc April 18, 2024 13:50
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

🎉

@obycode obycode requested review from hstove and jferrant April 18, 2024 17:43
@obycode obycode merged commit 9cb64be into develop Apr 18, 2024
1 of 2 checks passed
@obycode obycode deleted the chore/rust-scenario-test branch April 18, 2024 22:37
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants