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 ability to limit shrink path #5006

Merged
merged 21 commits into from
Jul 5, 2024
Merged

✨ Add ability to limit shrink path #5006

merged 21 commits into from
Jul 5, 2024

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented May 21, 2024

Description

We want to offer a way for our users to limit the depth and overall size of the shrinking capabilities. At the moment, they can only either apply shrink or drop it totally. We want to offer a finer way to control the shrinks.

This proposal is related to #4162.

At the moment, we added an extra method for all our arbitrary but I feel that it will not be scalable. I believe we should go for yet another utility arbitrary that will be responsible to offer such capabilities. Regarding offering these capabilities at assert level itself, we should probably (option 1) do as we used to do for timeouts..., or (option 2) start thinking into some kind of plugin system. Option 1 seems to be a valid option for version 3 of fast-check, we could also start offering a noShrink utility either hidden behind limitShrink one (probably better) or directly.

NOTE: Not ready yet, we should move from methods to a dedicated utility.

ChecklistDon't delete this checklist and make sure you do the following before opening the PR

  • The name of my PR follows gitmoji specification
  • My PR references one of several related issues (if any)
    • New features or breaking changes must come with an associated Issue or Discussion
    • My PR does not add any new dependency without an associated Issue or Discussion
  • My PR includes bumps details, please run yarn bump and flag the impacts properly
  • My PR adds relevant tests and they would have failed without my PR (when applicable)

Advanced

  • Category: ✨ Introduce new features
  • Impacts: New arbitrary

Copy link

codesandbox-ci bot commented May 21, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dd752cb:

Sandbox Source
@fast-check/examples Configuration

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 98.65772% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.90%. Comparing base (8483134) to head (dd752cb).
Report is 7 commits behind head on main.

Files Patch % Lines
packages/fast-check/src/arbitrary/limitShrink.ts 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5006      +/-   ##
==========================================
+ Coverage   96.89%   96.90%   +0.01%     
==========================================
  Files         215      218       +3     
  Lines       16384    16533     +149     
  Branches     2670     2703      +33     
==========================================
+ Hits        15875    16022     +147     
- Misses        509      511       +2     
Flag Coverage Δ
unit-tests 96.90% <98.65%> (+0.01%) ⬆️
unit-tests-18.x-Linux 96.90% <98.65%> (+0.01%) ⬆️
unit-tests-20.x-Linux 96.90% <98.65%> (+0.01%) ⬆️
unit-tests-22.x-Linux 96.90% <98.65%> (+0.01%) ⬆️
unit-tests-latest-Linux ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dubzzz dubzzz added the 🧪 Experiment Performing some experiments for potential future features implying deep changes label May 21, 2024
Copy link
Contributor

👋 A preview of the new documentation is available at: http://667d1456a4794187f64145a3--dubzzz-fast-check.netlify.app

@dubzzz dubzzz removed the 🧪 Experiment Performing some experiments for potential future features implying deep changes label Jul 5, 2024
@dubzzz dubzzz enabled auto-merge (squash) July 5, 2024 12:27
Copy link
Contributor

github-actions bot commented Jul 5, 2024

👋 A preview of the new documentation is available at: http://6687fae2757d6a6f1c407228--dubzzz-fast-check.netlify.app

@dubzzz dubzzz merged commit 56a3468 into main Jul 5, 2024
59 checks passed
@dubzzz dubzzz deleted the limit-shrink branch July 5, 2024 13:55
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.

1 participant