-
Notifications
You must be signed in to change notification settings - Fork 101
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
Streamline the way that test iteration count is determined (replace NTESTS
)
#379
Conversation
858a56c
to
4f2b124
Compare
NTESTS
with a better configurationNTESTS
)
8dc619a
to
7f851d9
Compare
7f851d9
to
343764c
Compare
0be0b07
to
b02ca43
Compare
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. |
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.