Skip to content

Conversation

@wconrad
Copy link

@wconrad wconrad commented Jun 17, 2017

Cause tests to be repeatable for all MRI versions from 2.0 through 2.4.

  • Monkey-patch built-sorts to force them to be unstable in all Rubies.
    Some rubies (such as MRI >= 2.2) have stable sorts, which can cause
    the tests to pass erroneously. See
    https://stackoverflow.com/a/44486562/238886 for more about sort
    stability in Ruby

  • Set the random number seed in order to make tests repeatable. Since
    the tests sort relatively short arrays, random chance would
    sometimes cause erroneous test failures.

  • Some tests checked that Ruby's built-in sort is unstable. Those
    checks were moved into their own sections and expanded. Now every
    Ruby built-in sort method is tested for to ensure that it is
    unstable.

wconrad added 2 commits June 17, 2017 07:00
* Monkey-patch built-sorts to force them to be unstable in all Rubies.
  Some rubies (such as MRI >= 2.2) have stable sorts, which can cause
  the tests to pass erroneously.  See
  https://stackoverflow.com/a/44486562/238886 for more about sort
  stability in Ruby

* Set the random number seed in order to make tests repeatable.  Since
  the tests sort relatively short arrays, random chance would
  sometimes cause erroneous test failures.

* Some tests checked that Ruby's built-in sort is unstable.  Those
  checks were moved into their own sections and expanded.  Now every
  Ruby built-in sort method is tested for to ensure that it is
  unstable.
@coveralls
Copy link

Coverage Status

Coverage decreased (-6.6%) to 93.396% when pulling 18cc086 on wconrad:repeatable-tests into dca16d9 on awakia:master.

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.

2 participants