~/talk

"RSpec no longer works with ActiveRecord"

Talkat RubyConf 2017 · 2017-11-15..11-17· [testing]
slides:none on file

A regression causes RSpec mocks to raise when stubbing ActiveRecord scopes because code calls define_attribute_methods on ActiveRecord::Base which explodes for abstract base classes; reproduction shows tests pass on 3.2.0 and fail on 3.2.0→3.3.0; debugging uses a cloneable app, full Gemfile.lock and git bisect across rspec-rails and rspec-mocks, hitting a deleted object_inspector helper and a commit that added the unsafe callback; the fix is a simple guard avoiding Base and a followup generic patch and tests, the bisection takes far longer than the five minute patch.

AI-written summary · about

  1. 0:00Start
  2. 4:13Back to our issue
  3. 5:56A Steps to reproduce A Ruby Version
  4. 9:00Open source is collaborative
  5. 9:38We're still missing something
  6. 10:15Let's actually debug this
  7. 14:15We could start debugging here
  8. 15:08git bisect start
  9. 18:31git checkout HEAD
  10. 20:43Same thing, but with RSpec mocks
  11. 21:47Bisecting old code can be a dangerous mess
  12. 25:12Active Record::Base .define_attribute_methods
  13. 25:49Aftermath
  14. 26:24RSpec rails was critically broken
  15. 27:39Pro-tips
  16. 27:55Telling the maintainer there is a bug
  17. 28:20Providing a backtrace
  18. 28:44Providing dependency information
  19. 29:11Providing a reproduction case to clone
  20. 29:48Bisecting to an exact commit
  21. 31:41My team is hiring
  22. 32:35Recording and Production Confreaks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.