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

Improvements to existing unit tests #48

Open
3 tasks done
sylvainhalle opened this issue Aug 26, 2021 · 1 comment
Open
3 tasks done

Improvements to existing unit tests #48

sylvainhalle opened this issue Aug 26, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@sylvainhalle
Copy link
Contributor

sylvainhalle commented Aug 26, 2021

  • Unit tests should not write output to the console. This requires manual intervention by developers to verify the output printed on the console to check if the test ran successfully or not, which defeats the purpose of automated testing in a continuous integration environment such as Travis.
  • A few tests are needlessly long. An example is GaussianFloatTest.sameValuesSameSeed(), which tests 10,000 pairs of pickers for their first 10,000 values each. This amounts to 200 million calls to pick(), which is probably overkill in the context, and makes that single test case last for almost 10 seconds. This is especially important since every build in the Travis platform consumes credits based on execution time. Reduce to 100 repetitions.
  • In that same test, the seed for the pickers is itself picked at random. This makes the test case susceptible to being non reproducible: re-running a failing test may result in a passing test, and vice versa, due to the chance of picking different seeds each time. It would be preferable to randomly pick a list of seeds, then hard-code that list into the test so that the state of each execution is identical. (Same for other tests that do the same thing.)
@sylvainhalle sylvainhalle added the enhancement New feature or request label Aug 26, 2021
map555 added a commit that referenced this issue Sep 24, 2021
@sylvainhalle
Copy link
Contributor Author

The random tests still take too long. They need close to a minute to complete on my computer.

Screenshot from 2021-10-11 08-57-36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants