This one really caught me off guard:
I run an unusual database structure, but I think this would catch standard users off guard too.
With the default config for tests in Rails 6.1:
parallelize(workers: :number_of_processors)
the database gets truncated just before the tests run. This seems to have been put in place to support the new, more complicated database structure support.
In my case, I’m seeding a bunch of data into the database and this just wipes it out.
I was wondering what the purpose was for this and if there’s a way to work around it other than disabling the parallel testing feature?
The change seems to have come in here:
https://github.com/rails/rails/commit/d8b817134391b497eb6fa0a9dd2790157812411d