Hi,

I'd like to propose shuffle insert fixtures at ActiveRecord unit tests
to find and address tests which depend on non-deterministic sort order 
easily.

* Background

Since [Unlock minitest for Rails' test 
suite](https://github.com/rails/rails/pull/29271)
has been merged to master, there are some fixes made to address 
non-deterministic sort order. 

https://github.com/rails/rails/pull/30228
https://github.com/rails/rails/pull/30152
https://github.com/rails/rails/pull/30133

All of these fixes found when ActiveRecord unit tests are executed with 
PostgreSQL database.
It is likely due to PostgreSQL performs append write, do not perform in 
place update.

Here, I do not mean which architecture is good or bad. I wanted to say it 
is an application responsibility to write SQL statement to guarantee sort 
order. 
Changing load fixture order would help to find and address tests depending 
on un-guaranteed sort order.

* Test

I have created a `shuffle_fixtures` branch and updated `insert_fixtures` 
method 
to shuffle fixtures and executed ActiveRecord unit tests with postgresql 
adapter.

- `shuffle_fixtures` branch
https://github.com/yahonda/rails/tree/shuffle_fixtures

- Commit to shuffle fixtures
https://github.com/yahonda/rails/commit/c41361aa35078101c0b840497fae92078c511ff1

* Test results with postgresql adapter 

"5654 runs, 15575 assertions, 13 failures, 0 errors, 2 skips"
https://gist.github.com/yahonda/7898ec69325dcb70c5e6efdc7f74d174

I'd like to hear from developers working on ActiveRecord development.

Thanks,
--
Yasuo Honda

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to