This repository was archived by the owner on Apr 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Streamline the way that test iteration count is determined (replace NTESTS
)
#379
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
858a56c
to
4f2b124
Compare
NTESTS
with a better configurationNTESTS
)
8dc619a
to
7f851d9
Compare
7f851d9
to
343764c
Compare
0be0b07
to
b02ca43
Compare
This was referenced Jan 2, 2025
d28f70c
to
e302812
Compare
Occasionally it is useful to see some information from running tests without making everything noisy from `--nocapture`. Add a function to log this kind of output to a file, and print the file as part of CI.
Currently, tests use a handful of constants to determine how many iterations to perform: `NTESTS`, `AROUND`, and `MAX_CHECK_POINTS`. This configuration is not very straightforward to adjust and needs to be repeated everywhere it is used. Replace this with new functions in the `run_cfg` module that determine iteration counts in a more reusable and documented way. This only updates `edge_cases` and `domain_logspace`, `random` is refactored in a later commit.
Introduce the `KnownSize` iterator wrapper, which allows providing the size at construction time. This provides an `ExactSizeIterator` implemenation so we can check a generator's value count during testing.
Currently, all inputs are generated and then cached. This works reasonably well but it isn't very configurable or extensible (adding `f16` and `f128` is awkward). Replace this with a trait for generating random sequences of tuples. This also removes possible storage limitations of caching all inputs.
2d8b0d4
to
c93054b
Compare
Added @quaternic's Zulip suggestion to randomize the seed with a way to override it so we wind up with better test coverage over time. |
c93054b
to
ac3ff8c
Compare
I am going to merge this so I can get other dependent changes in, as always continued reviews are welcome. |
Apologies for the delay, LGTM. |
tgross35
added a commit
that referenced
this pull request
Apr 18, 2025
Streamline the way that test iteration count is determined (replace `NTESTS`)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, tests use a handful of constants to determine how many iterations to perform:
NTESTS
,AROUND
, andMAX_CHECK_POINTS
. This configuration is not very straightforward to adjust and needs to be repeated everywhere it is used.Replace this with new functions in the
run_cfg
module that determine iteration counts in a more reusable and documented way.This also changes the random generator to generate inputs on the fly rather than caching.