Skip to content

Instantly share code, notes, and snippets.

@cpb
Last active October 31, 2018 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpb/3698d9c447d9b8c156277875cd2fb69f to your computer and use it in GitHub Desktop.
Save cpb/3698d9c447d9b8c156277875cd2fb69f to your computer and use it in GitHub Desktop.
Minitest 6 Todo

  • Scale

    Mostly it would be pointing out code that relies on bad architecture (eg global / class-level variables) that make them brittle or have race conditions. Changing your architecture or implementation so that the code is parallel-safe means you really can scale your software up (by adding threads or processes or distributing the work).

    But it’s also an opportunity to simply have faster developer feedback. The faster your tests can run, the faster your devs can go with full information. Otherwise there’s a window where they’re either waiting or coding blind.


  • Parallelism by default:
    • [ ]
    -- parallelize_me!
    ++ serialize_me!
    • DB Testing
      • Transactional
      • Non-transactional
    • Stubbing class methods?
      • IE: Time.now

  • All tests shuffled, rather than class by class basis

  • Worker-based Distributed Testing
    • Locally
    • CPU Utilization
    • Across VMs
    • Speed Up CI
    • Config?
    • Setup?
    • Dependencies
      • SSH Access
      • Open ports (or tunneling?)
      • Same source layout (ie: container based testing)
      • True for non unix platforms?
    • Available libraries?
      • tmm1/test-queue (used by github)
      • jeremyevans/minitest-parallel_fork
      • ArturT/knapsack (paid service)
      • Shopify



  • Rake's TestTask

  • Improved Test Doubles
    • stub w/ blocks
    • Adding fake?
      • singleton_method (too easy? truly needed?)

  • Stricter and Better Assertions
    • assert_equal(nil,x) => Failure
      • Unhack nested refute_nil
      • More Explicit, Signal intent
    • Fix Tautological Tests
    • Assertion Reuse
      • assert_operator, assert_predicate call assert_respond_to
        • (assert|refute)_empty
        • (assert|refute)_includes
        • (assert|refute)_match
        • (assert|refute)_operator
        • (assert|refute)_predicate
      • remove call to message in assert_empty
      • Better Failures
        • -- Error: NoMethodError (undefined method `message’ for #<X:Y>).
          ++ Failure: Expected X to respond to message.
        • Better Messages
        • Better Message with layered assertions
      • Remove assert_send
      • Better Failure messages for multiline strings

  • Improved Specs
    • No more expectations on Object \
      -- o.m.must_equal 42
      ++ _(o.m).must_equal 42
      ++ value(o.m).must_equal 42
      • CheezitMan
        • s/expect/_/
      • Deprecation warning
      • Internal migration

  • Benchmarking
    • assert_performance_logarithmic
    • assert_performance_exponential
    • assert_performance_constant
    • validation_for_fit
    • assert_performance
    • assert_performance_power
    • assert_performance_linear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment