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

Add property tests for PoX-4 read-only functions #4470

Merged
merged 27 commits into from Mar 12, 2024

Conversation

BowTiedRadone
Copy link
Contributor

@BowTiedRadone BowTiedRadone commented Mar 1, 2024

Description

This PR adds property tests for PoX-4 read-only functions.

@CLAassistant
Copy link

CLAassistant commented Mar 1, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.25%. Comparing base (067633d) to head (ad0e265).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4470      +/-   ##
==========================================
+ Coverage   83.22%   83.25%   +0.02%     
==========================================
  Files         452      452              
  Lines      326058   326058              
  Branches      323      323              
==========================================
+ Hits       271357   271445      +88     
+ Misses      54693    54605      -88     
  Partials        8        8              

see 26 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 067633d...ad0e265. Read the comment docs.

setzeus

This comment was marked as duplicate.

@setzeus setzeus self-requested a review March 4, 2024 13:35
Copy link
Collaborator

@setzeus setzeus left a comment

Choose a reason for hiding this comment

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

Great job on these tests! They seem p straight-forward read-only checks since there's no way to mock stacking here.

I only have one blocking comment atm.

contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
- get-check-delegation
- get-delegation-info
- get-allowance-contract-callers
- get-pox-info
- minimal-can-stack-stx
@moodmosaic moodmosaic changed the title added property tests for pox-4 read only functions Add property tests for PoX-4 read only functions Mar 7, 2024
@moodmosaic moodmosaic changed the title Add property tests for PoX-4 read only functions Add property tests for PoX-4 read-only functions Mar 7, 2024
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.

Great work. Left a couple of comments, mostly on the way some generators are configured.

contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
contrib/core-contract-tests/tests/pox-4/pox-4.prop.test.ts Outdated Show resolved Hide resolved
@BowTiedRadone
Copy link
Contributor Author

@hugocaillard
Regarding checks, one of the test fails, even if it works locally. What to do in this situation?
https://github.com/stacks-network/stacks-core/actions/runs/8202455709/job/22433699088?pr=4470

It is this test that first allows the contract caller and then checks that the result is some. Maybe the simnet does not work as expected when run there.

moodmosaic
moodmosaic previously approved these changes Mar 8, 2024
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.

LGTM 🙌

@moodmosaic
Copy link
Member

@setzeus can you do another round of review as well?

Copy link
Collaborator

@setzeus setzeus left a comment

Choose a reason for hiding this comment

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

Overall this looks great! Just getting one test failing locally seen below, once that's updated/fixed this should be good to go.

Co-authored-by: Nikos Baxevanis <nikos.baxevanis@gmail.com>
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.

LGTM

@moodmosaic moodmosaic requested a review from setzeus March 11, 2024 11:30
@moodmosaic
Copy link
Member

Overall this looks great! Just getting one test failing locally seen below, once that's updated/fixed this should be good to go.

@setzeus failing test has been fixed.

Copy link
Collaborator

@setzeus setzeus left a comment

Choose a reason for hiding this comment

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

Can confirm no more errors, appreciate the hard work here @BowTiedRadone - LGTM!

@hugocaillard
Copy link
Collaborator

Looking at this now. I assume this comment #4470 (comment) is no longer relevant right?

@moodmosaic
Copy link
Member

Looking at this now. I assume this comment #4470 (comment) is no longer relevant right?

It could be an issue with the test assertion, and not an actual bug. I would say don't spend time on it (unless you actually see/spot a potential bug looking at the stack trace).

@hugocaillard
Copy link
Collaborator

In this job, the error comes from .toSorted() is not a function. That's because a certain version of the sdk used toSorted that is only available in Node >= 20. It has been fixed, you need to use the latest version of @hirosystems/clarinet-sdk and @stacks/transactions to avoid that

@wileyj wileyj added this pull request to the merge queue Mar 12, 2024
Merged via the queue into stacks-network:next with commit ae8a483 Mar 12, 2024
2 checks passed
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.

None yet

6 participants