unreliable 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +136 -43
- data/lib/unreliable/version.rb +1 -1
- data/spec/examples.txt +12 -12
- metadata +20 -49
- data/Appraisals +0 -32
- data/gemfiles/activerecord_5.0.gemfile +0 -8
- data/gemfiles/activerecord_5.0.gemfile.lock +0 -143
- data/gemfiles/activerecord_5.1.gemfile +0 -8
- data/gemfiles/activerecord_5.1.gemfile.lock +0 -143
- data/gemfiles/activerecord_5.2.gemfile +0 -8
- data/gemfiles/activerecord_5.2.gemfile.lock +0 -143
- data/gemfiles/activerecord_6.0.gemfile +0 -7
- data/gemfiles/activerecord_6.0.gemfile.lock +0 -143
- data/gemfiles/activerecord_6.1.gemfile +0 -7
- data/gemfiles/activerecord_6.1.gemfile.lock +0 -142
- data/gemfiles/activerecord_7.0.gemfile +0 -7
- data/gemfiles/activerecord_7.0.gemfile.lock +0 -142
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0081b3f189f7e459a112514a5c35d69bd903fbdc771b6eccd22bb53add828671'
|
4
|
+
data.tar.gz: 0a5c663105b2f774cb64eb464340e36d8c63d393234e0cb855955487800d501f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798bef481aad072fa47730866506a6e040d5b99dea6b71f0af5ca86921380f42713b98182c813f7da2a9a152215e9a2a35a730923f10e3e35c389a5ffa78dd68
|
7
|
+
data.tar.gz: 41d0546cf89f4bb0a2c66e98042fb6f27b4a57391ef7e0e25392a1b0a6eaa14064c6f9bd6e12915a05f8425656a62f794d48ab2ab45f08045b2ad3bfa4e79794
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## Unreliable 0.1.3 (August 21, 2022) ##
|
2
|
+
|
3
|
+
* README and minor gemspec changes.
|
4
|
+
|
5
|
+
## Unreliable 0.1.2 (April 27, 2022) ##
|
6
|
+
|
7
|
+
* README and internal dependency changes.
|
8
|
+
|
9
|
+
## Unreliable 0.1.1 (March 2, 2022) ##
|
10
|
+
|
11
|
+
* Internal dependency changes.
|
12
|
+
|
1
13
|
## Unreliable 0.1.0 (March 1, 2022) ##
|
2
14
|
|
3
15
|
* Initial release.
|
data/README.md
CHANGED
@@ -1,42 +1,111 @@
|
|
1
1
|
# Unreliable
|
2
2
|
|
3
3
|
![CI workflow](https://github.com/jamiemccarthy/unreliable/actions/workflows/ci.yml/badge.svg)
|
4
|
-
|
4
|
+
![Gem version](https://img.shields.io/gem/v/unreliable)
|
5
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
6
|
+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa)](CODE_OF_CONDUCT.md)
|
5
7
|
|
6
|
-
|
8
|
+
**The `unreliable` gem forces your ActiveRecord tests not to rely on ambiguous ordering. This makes your app and its tests more robust.**
|
7
9
|
|
8
|
-
|
10
|
+
## Installation
|
9
11
|
|
10
|
-
|
12
|
+
Add `unreliable` to your `Gemfile`'s `test` group:
|
11
13
|
|
12
|
-
|
14
|
+
```ruby
|
15
|
+
# Gemfile
|
13
16
|
|
14
|
-
|
17
|
+
group :test do
|
18
|
+
gem "unreliable", "~> 0.1"
|
19
|
+
end
|
20
|
+
```
|
15
21
|
|
16
|
-
|
22
|
+
The next time your test suite runs, it may emit new errors and failures. If so, great!
|
17
23
|
|
18
|
-
|
24
|
+
## The problem with orders
|
19
25
|
|
20
|
-
|
26
|
+
Here's an [open secret](#references): **relational databases do not guarantee the order results are returned in, without a thorough `ORDER BY` clause.**
|
21
27
|
|
22
|
-
|
28
|
+
If all your ActiveRecord ordering is already unambiguous, congratulations! `unreliable` will have no effect.
|
23
29
|
|
24
|
-
|
30
|
+
But sometimes we think we specified an unambiguous order, but didn't. Maybe we ordered on timestamps, which are usually unique but sometimes not. And the test suite will stay silent as long as our database just happens to return the same order.
|
25
31
|
|
26
|
-
|
32
|
+
If ambiguous ordering is fine for your app's purposes, but your tests rely on a specific order, that's a bug in your tests. Your tests are incorrectly failing -- rarely -- which can be confusing and annoying.
|
27
33
|
|
28
|
-
|
34
|
+
Or, if your Rails code relies on that accidental ordering, that's a bug in your app. Your tests are passing when they should be failing.
|
29
35
|
|
30
|
-
|
36
|
+
In both cases, `unreliable` exposes the problem by making those tests fail most of the time.
|
31
37
|
|
32
|
-
|
38
|
+
## Fixing the new failures
|
33
39
|
|
34
|
-
|
35
|
-
* ORDER BY values that are identical within the [prefix length limit](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_sort_length) examined for sorting
|
40
|
+
When `unreliable` turns up a new test failure, you fix it in one of two ways. Either relax your test so it stops relying on order, or tighten up your app to specify order rigorously. (In my company's app, it was about 50/50.)
|
36
41
|
|
37
|
-
|
42
|
+
### Relax a test
|
43
|
+
|
44
|
+
Take a look at what your test is checking. If you're testing a method or an endpoint that returns a list whose order doesn't matter, you may have written it to expect the order that was returned the first time you ran it. This often happens with fixtures. You might:
|
45
|
+
|
46
|
+
* Make your test accept all correct answers. For example, sort an array in the method's response before comparing.
|
47
|
+
|
48
|
+
* Help your test suite focus on what you're testing. If your fixtures' "latest" element could change because they don't specify a timestamp, that might be a distraction that's not relevant to how your app works, so you could assign timestamps to the fixtures.
|
49
|
+
|
50
|
+
This makes your test suite more robust.
|
51
|
+
|
52
|
+
If your test suite is checking generated `.to_sql` against known-good SQL text, `unreliable` isn't helpful. It's easiest to use `Unreliable::Config.disable { ... }` to turn it off for a block.
|
53
|
+
|
54
|
+
### Tighten the app
|
55
|
+
|
56
|
+
If your app should be returning results in a particular order, and now with `unreliable` it sometimes does not, your test is correct and your app is wrong. Specify order rigorously in your app.
|
57
|
+
|
58
|
+
Maybe you're testing `Book.reverse_chron.first`, and you've defined that ordering this way:
|
59
|
+
|
60
|
+
```
|
61
|
+
class Book
|
62
|
+
scope :reverse_chron, -> { order(year_published: :desc) }
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
When you meant to define it unambiguously:
|
67
|
+
|
68
|
+
```
|
69
|
+
scope :reverse_chron, -> { order(year_published: :desc, title: :desc) }
|
70
|
+
```
|
71
|
+
|
72
|
+
Or, if `title` is not unique:
|
73
|
+
|
74
|
+
```
|
75
|
+
scope :reverse_chron, -> { order(year_published: :desc, title: :desc, id: :desc) }
|
76
|
+
```
|
77
|
+
|
78
|
+
The problem in this example is easy to see because many books are published each year. But this error can occur at any time granularity.
|
79
|
+
|
80
|
+
## Requirements
|
81
|
+
|
82
|
+
`unreliable` is tested to support Ruby 2.6 through 3.1, and Rails 5.0 through 7.0.
|
38
83
|
|
39
|
-
|
84
|
+
As of August 2022, this is all released versions of both that are currently supported, plus several older releases.
|
85
|
+
|
86
|
+
`unreliable` depends only on ActiveRecord and Railties. If you have a non-Rails app that uses ActiveRecord, you can still use it.
|
87
|
+
|
88
|
+
## Implementation
|
89
|
+
|
90
|
+
`unreliable` does exactly nothing outside of test environments. There is intentionally no way to enable `unreliable` in production, and there never will be.
|
91
|
+
|
92
|
+
In a Rails test environment, `unreliable` patches ActiveRecord to always append a final `ORDER BY` clause that returns results in a random order.
|
93
|
+
|
94
|
+
Because it's appended, the existing ordering is not affected unless it is ambiguous.
|
95
|
+
|
96
|
+
With `unreliable` installed, every ActiveRecord relation invoked by the test suite will have any ambiguity replaced with randomness. Tests that rely on the ordering of two records will break half the time. Tests with three or more break most of the time.
|
97
|
+
|
98
|
+
`unreliable` patches `ActiveRecord::QueryMethods#build_arel`, the point where an Arel is converted for use, to append an order to the existing order chain. (The patch is applied after ActiveRecord loads, using `ActiveSupport.on_load`, the standard interface since Rails 4.0.) It works with MySQL, Postgres, and SQLite.
|
99
|
+
|
100
|
+
This means that the `ORDER BY` applies to not just `SELECT` but e.g. `delete_all` and `update_all`. It also applies within subqueries.
|
101
|
+
|
102
|
+
The patch is only applied when `Rails.env.test?`, and that boolean is also checked on every invocation, just to make certain it has no effect in any other environment.
|
103
|
+
|
104
|
+
## Contributing
|
105
|
+
|
106
|
+
Thoughts and suggestions are welcome. Please read the code of conduct, then create an issue or pull request on GitHub. If you just have questions, go ahead and open an issue, I'm pretty friendly.
|
107
|
+
|
108
|
+
### Run the gem's tests
|
40
109
|
|
41
110
|
To test locally, against the different versions of ActiveRecord, use Ruby 2.7, the only version currently compatible with all the ActiveRecord versions supported. Install the required gems with:
|
42
111
|
|
@@ -46,7 +115,13 @@ bundle install
|
|
46
115
|
bundle exec appraisal install
|
47
116
|
```
|
48
117
|
|
49
|
-
|
118
|
+
Run `unreliable`'s linter with:
|
119
|
+
|
120
|
+
```
|
121
|
+
bundle exec standardrb
|
122
|
+
```
|
123
|
+
|
124
|
+
Then you can run `unreliable`'s tests with:
|
50
125
|
|
51
126
|
```
|
52
127
|
bundle exec appraisal rake
|
@@ -54,44 +129,62 @@ bundle exec appraisal rake
|
|
54
129
|
|
55
130
|
Appraisal ensures the tests run against every compatible minor version of ActiveRecord.
|
56
131
|
|
57
|
-
The GitHub CI workflow in `.github/` ensures those tests are also run against against every compatible minor version of Ruby.
|
132
|
+
The GitHub CI workflow in `.github/` ensures those tests are also run against against every compatible minor version of Ruby. Your PR won't trigger my GitHub project's workflow, but you're welcome to run your own, or ask me to run mine manually.
|
58
133
|
|
59
|
-
Testing against ActiveRecord is done with [Combustion](https://github.com/pat/combustion), which stands up a local single-table SQLite database and an ActiveRecord-based model for it. This gives
|
134
|
+
Testing against ActiveRecord is done with [Combustion](https://github.com/pat/combustion), which stands up a local single-table SQLite database and an ActiveRecord-based model for it. This gives more reliable coverage than mocking unit tests within ActiveRecord itself.
|
60
135
|
|
61
|
-
|
136
|
+
### Experiment
|
62
137
|
|
138
|
+
If you'd like to see `unreliable` in action on a small but real Rails app locally, you can do this:
|
139
|
+
|
140
|
+
1. In a directory next to your `unreliable` working directory, create a `.ruby-version` of `2.7.6` and a 2-line `Gemfile`: `source "https://rubygems.org"`, `gem "rails", "~> 7.0"`
|
141
|
+
2. `bundle install && bundle exec rails new . --force`
|
142
|
+
3. `echo 'gem "unreliable", path: "../unreliable"' >> Gemfile`
|
143
|
+
4. `bundle install && bundle exec rails generate model post title:string body:text`
|
144
|
+
5. `RAILS_ENV=test bundle exec rails db:migrate`
|
145
|
+
6. `RAILS_ENV=test bundle exec rails c`
|
146
|
+
7. You should see SQLite's `ORDER BY RANDOM()` in ActiveRecord queries:
|
147
|
+
|
148
|
+
```
|
149
|
+
irb(main):001:0> Post.where(title: "abc")
|
150
|
+
(2.1ms) SELECT sqlite_version(*)
|
151
|
+
Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."title" = ? ORDER BY RANDOM() [["title", "abc"]]
|
152
|
+
=> []
|
153
|
+
irb(main):002:0> Post.limit(5).delete_all
|
154
|
+
Post Delete All (0.2ms) DELETE FROM "posts" WHERE "posts"."id" IN (SELECT "posts"."id" FROM "posts" ORDER BY RANDOM() LIMIT ?) [["LIMIT", 5]]
|
155
|
+
=> 0
|
63
156
|
```
|
64
|
-
Start with 1-line Gemfile `gem "rails", "~> x.y"`, bundle install, then
|
65
157
|
|
66
|
-
|
158
|
+
## Ordering trivia
|
67
159
|
|
68
|
-
|
160
|
+
The most common ambiguous ordering is an ORDER BY one column that is not unique, like a timestamp.
|
69
161
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
162
|
+
But there are other ways you can order a relation but still have your query be ambiguous:
|
163
|
+
|
164
|
+
* ORDER BY multiple columns, but with no subset which is unique
|
165
|
+
* ORDER BY a column with values that differ only by [character case](https://dev.mysql.com/doc/refman/8.0/en/sorting-rows.html)
|
166
|
+
* ORDER BY values that are identical within the [prefix length limit](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_sort_length) examined for sorting
|
167
|
+
|
168
|
+
`unreliable` correctly tests these because the random order is always appended.
|
169
|
+
|
170
|
+
## References
|
78
171
|
|
79
|
-
|
172
|
+
SQL standard ([SQL-92](https://web.archive.org/web/20220730144627/https://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt)):
|
80
173
|
|
81
|
-
When
|
174
|
+
> When the ordering of a cursor is partially determined by an _order by clause_, then the relative positions of two rows are determined only by the _order by clause_; if the two rows have equal values for the purpose of evaluating the _order by clause_, then their relative positions are implementation-dependent.
|
82
175
|
|
83
|
-
|
176
|
+
MySQL ([5.6](https://dev.mysql.com/doc/refman/5.6/en/limit-optimization.html), [5.7](https://dev.mysql.com/doc/refman/5.7/en/limit-optimization.html), [8.0](https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html)):
|
84
177
|
|
85
|
-
|
178
|
+
> If multiple rows have identical values in the `ORDER BY` columns, the server is free to return those rows in any order, and may do so differently depending on the overall execution plan. In other words, the sort order of those rows is nondeterministic with respect to the nonordered columns.
|
86
179
|
|
87
|
-
|
180
|
+
Postgres ([12](https://www.postgresql.org/docs/12/sql-select.html#SQL-ORDERBY), [13](https://www.postgresql.org/docs/13/sql-select.html#SQL-ORDERBY), [14](https://www.postgresql.org/docs/14/sql-select.html#SQL-ORDERBY)):
|
88
181
|
|
89
|
-
|
182
|
+
> If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order.
|
90
183
|
|
91
|
-
|
184
|
+
SQLite ([3.39](https://www.sqlite.org/lang_select.html#the_order_by_clause)):
|
92
185
|
|
93
|
-
|
186
|
+
> The order in which two rows for which all ORDER BY expressions evaluate to equal values are returned is undefined.
|
94
187
|
|
95
|
-
|
188
|
+
## See also
|
96
189
|
|
97
190
|
[chaotic_order](https://rubygems.org/gems/chaotic_order)
|
data/lib/unreliable/version.rb
CHANGED
data/spec/examples.txt
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
---------------------------------- | ------ | --------------- |
|
3
|
-
./spec/env_spec.rb[1:1] | passed | 0.
|
4
|
-
./spec/env_spec.rb[1:2] | passed | 0.
|
5
|
-
./spec/model_select_spec.rb[1:1] | passed | 0.
|
6
|
-
./spec/model_select_spec.rb[1:2] | passed | 0.
|
7
|
-
./spec/model_select_spec.rb[1:3] | passed | 0.
|
8
|
-
./spec/model_select_spec.rb[1:4] | passed | 0.
|
9
|
-
./spec/model_subquery_spec.rb[1:1] | passed | 0.
|
10
|
-
./spec/model_update_spec.rb[1:1] | passed | 0.
|
11
|
-
./spec/railtie_spec.rb[1:1] | passed | 0.
|
12
|
-
./spec/railtie_spec.rb[1:2] | passed | 0.
|
13
|
-
./spec/version_spec.rb[1:1] | passed | 0.
|
14
|
-
./spec/version_spec.rb[1:2] | passed | 0.
|
3
|
+
./spec/env_spec.rb[1:1] | passed | 0.00261 seconds |
|
4
|
+
./spec/env_spec.rb[1:2] | passed | 0.00042 seconds |
|
5
|
+
./spec/model_select_spec.rb[1:1] | passed | 0.00033 seconds |
|
6
|
+
./spec/model_select_spec.rb[1:2] | passed | 0.0005 seconds |
|
7
|
+
./spec/model_select_spec.rb[1:3] | passed | 0.00042 seconds |
|
8
|
+
./spec/model_select_spec.rb[1:4] | passed | 0.00064 seconds |
|
9
|
+
./spec/model_subquery_spec.rb[1:1] | passed | 0.00135 seconds |
|
10
|
+
./spec/model_update_spec.rb[1:1] | passed | 0.00011 seconds |
|
11
|
+
./spec/railtie_spec.rb[1:1] | passed | 0.00064 seconds |
|
12
|
+
./spec/railtie_spec.rb[1:2] | passed | 0.00014 seconds |
|
13
|
+
./spec/version_spec.rb[1:1] | passed | 0.00116 seconds |
|
14
|
+
./spec/version_spec.rb[1:2] | passed | 0.00016 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unreliable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James McCarthy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '8.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '8.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: railties
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,6 +37,9 @@ dependencies:
|
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: '5.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '8.0'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +47,9 @@ dependencies:
|
|
38
47
|
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
49
|
version: '5.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '8.0'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: appraisal
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,46 +108,18 @@ dependencies:
|
|
96
108
|
version: '13.0'
|
97
109
|
- !ruby/object:Gem::Dependency
|
98
110
|
name: rspec
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.25'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.25'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: simplecov
|
127
111
|
requirement: !ruby/object:Gem::Requirement
|
128
112
|
requirements:
|
129
113
|
- - "~>"
|
130
114
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
115
|
+
version: '3.0'
|
132
116
|
type: :development
|
133
117
|
prerelease: false
|
134
118
|
version_requirements: !ruby/object:Gem::Requirement
|
135
119
|
requirements:
|
136
120
|
- - "~>"
|
137
121
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
122
|
+
version: '3.0'
|
139
123
|
- !ruby/object:Gem::Dependency
|
140
124
|
name: sqlite3
|
141
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,41 +140,28 @@ dependencies:
|
|
156
140
|
requirements:
|
157
141
|
- - "~>"
|
158
142
|
- !ruby/object:Gem::Version
|
159
|
-
version: '1.
|
143
|
+
version: '1.11'
|
160
144
|
type: :development
|
161
145
|
prerelease: false
|
162
146
|
version_requirements: !ruby/object:Gem::Requirement
|
163
147
|
requirements:
|
164
148
|
- - "~>"
|
165
149
|
- !ruby/object:Gem::Version
|
166
|
-
version: '1.
|
150
|
+
version: '1.11'
|
167
151
|
description: |
|
168
152
|
Unreliable helps uncover bugs in Rails apps that rely on ambiguous database ordering.
|
169
|
-
|
153
|
+
Installing it makes both your app and your test suite more robust.
|
170
154
|
email: jamie@mccarthy.vg
|
171
155
|
executables: []
|
172
156
|
extensions: []
|
173
157
|
extra_rdoc_files: []
|
174
158
|
files:
|
175
|
-
- Appraisals
|
176
159
|
- CHANGELOG.md
|
177
160
|
- CODE_OF_CONDUCT.md
|
178
161
|
- Gemfile
|
179
162
|
- LICENSE
|
180
163
|
- README.md
|
181
164
|
- Rakefile
|
182
|
-
- gemfiles/activerecord_5.0.gemfile
|
183
|
-
- gemfiles/activerecord_5.0.gemfile.lock
|
184
|
-
- gemfiles/activerecord_5.1.gemfile
|
185
|
-
- gemfiles/activerecord_5.1.gemfile.lock
|
186
|
-
- gemfiles/activerecord_5.2.gemfile
|
187
|
-
- gemfiles/activerecord_5.2.gemfile.lock
|
188
|
-
- gemfiles/activerecord_6.0.gemfile
|
189
|
-
- gemfiles/activerecord_6.0.gemfile.lock
|
190
|
-
- gemfiles/activerecord_6.1.gemfile
|
191
|
-
- gemfiles/activerecord_6.1.gemfile.lock
|
192
|
-
- gemfiles/activerecord_7.0.gemfile
|
193
|
-
- gemfiles/activerecord_7.0.gemfile.lock
|
194
165
|
- lib/unreliable.rb
|
195
166
|
- lib/unreliable/build_order.rb
|
196
167
|
- lib/unreliable/config.rb
|
@@ -228,5 +199,5 @@ requirements: []
|
|
228
199
|
rubygems_version: 3.1.6
|
229
200
|
signing_key:
|
230
201
|
specification_version: 4
|
231
|
-
summary:
|
202
|
+
summary: For ActiveRecord tests, surface ambiguous-ordering bugs
|
232
203
|
test_files: []
|
data/Appraisals
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# The appraisal gem seems to be a convenient way to use this small config file to
|
4
|
-
# build the gemfiles/* for the GitHub CI matrix.
|
5
|
-
# Any `bundle update/install` should be accompanied by `bundle exec appraisal update/install`
|
6
|
-
|
7
|
-
appraise "activerecord-5.0" do
|
8
|
-
gem "activerecord", "~> 5.0.0"
|
9
|
-
gem "sqlite3", "~> 1.3.6"
|
10
|
-
end
|
11
|
-
|
12
|
-
appraise "activerecord-5.1" do
|
13
|
-
gem "activerecord", "~> 5.1.0"
|
14
|
-
gem "sqlite3", "~> 1.3.6"
|
15
|
-
end
|
16
|
-
|
17
|
-
appraise "activerecord-5.2" do
|
18
|
-
gem "activerecord", "~> 5.2.0"
|
19
|
-
gem "sqlite3", "~> 1.3.6"
|
20
|
-
end
|
21
|
-
|
22
|
-
appraise "activerecord-6.0" do
|
23
|
-
gem "activerecord", "~> 6.0.0"
|
24
|
-
end
|
25
|
-
|
26
|
-
appraise "activerecord-6.1" do
|
27
|
-
gem "activerecord", "~> 6.1.0"
|
28
|
-
end
|
29
|
-
|
30
|
-
appraise "activerecord-7.0" do
|
31
|
-
gem "activerecord", "~> 7.0.0"
|
32
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
unreliable (0.1.0)
|
5
|
-
activerecord (>= 5.0)
|
6
|
-
railties (>= 5.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionpack (5.0.7.2)
|
12
|
-
actionview (= 5.0.7.2)
|
13
|
-
activesupport (= 5.0.7.2)
|
14
|
-
rack (~> 2.0)
|
15
|
-
rack-test (~> 0.6.3)
|
16
|
-
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
18
|
-
actionview (5.0.7.2)
|
19
|
-
activesupport (= 5.0.7.2)
|
20
|
-
builder (~> 3.1)
|
21
|
-
erubis (~> 2.7.0)
|
22
|
-
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
24
|
-
activemodel (5.0.7.2)
|
25
|
-
activesupport (= 5.0.7.2)
|
26
|
-
activerecord (5.0.7.2)
|
27
|
-
activemodel (= 5.0.7.2)
|
28
|
-
activesupport (= 5.0.7.2)
|
29
|
-
arel (~> 7.0)
|
30
|
-
activesupport (5.0.7.2)
|
31
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
|
-
i18n (>= 0.7, < 2)
|
33
|
-
minitest (~> 5.1)
|
34
|
-
tzinfo (~> 1.1)
|
35
|
-
appraisal (2.4.1)
|
36
|
-
bundler
|
37
|
-
rake
|
38
|
-
thor (>= 0.14.0)
|
39
|
-
arel (7.1.4)
|
40
|
-
ast (2.4.2)
|
41
|
-
builder (3.2.4)
|
42
|
-
combustion (1.3.5)
|
43
|
-
activesupport (>= 3.0.0)
|
44
|
-
railties (>= 3.0.0)
|
45
|
-
thor (>= 0.14.6)
|
46
|
-
concurrent-ruby (1.1.9)
|
47
|
-
crass (1.0.6)
|
48
|
-
diff-lcs (1.5.0)
|
49
|
-
docile (1.4.0)
|
50
|
-
erubis (2.7.0)
|
51
|
-
i18n (1.10.0)
|
52
|
-
concurrent-ruby (~> 1.0)
|
53
|
-
loofah (2.14.0)
|
54
|
-
crass (~> 1.0.2)
|
55
|
-
nokogiri (>= 1.5.9)
|
56
|
-
method_source (1.0.0)
|
57
|
-
minitest (5.15.0)
|
58
|
-
nokogiri (1.13.3-x86_64-linux)
|
59
|
-
racc (~> 1.4)
|
60
|
-
parallel (1.21.0)
|
61
|
-
parser (3.1.1.0)
|
62
|
-
ast (~> 2.4.1)
|
63
|
-
racc (1.6.0)
|
64
|
-
rack (2.2.3)
|
65
|
-
rack-test (0.6.3)
|
66
|
-
rack (>= 1.0)
|
67
|
-
rails-dom-testing (2.0.3)
|
68
|
-
activesupport (>= 4.2.0)
|
69
|
-
nokogiri (>= 1.6)
|
70
|
-
rails-html-sanitizer (1.4.2)
|
71
|
-
loofah (~> 2.3)
|
72
|
-
railties (5.0.7.2)
|
73
|
-
actionpack (= 5.0.7.2)
|
74
|
-
activesupport (= 5.0.7.2)
|
75
|
-
method_source
|
76
|
-
rake (>= 0.8.7)
|
77
|
-
thor (>= 0.18.1, < 2.0)
|
78
|
-
rainbow (3.1.1)
|
79
|
-
rake (13.0.6)
|
80
|
-
regexp_parser (2.2.1)
|
81
|
-
rexml (3.2.5)
|
82
|
-
rspec (3.11.0)
|
83
|
-
rspec-core (~> 3.11.0)
|
84
|
-
rspec-expectations (~> 3.11.0)
|
85
|
-
rspec-mocks (~> 3.11.0)
|
86
|
-
rspec-core (3.11.0)
|
87
|
-
rspec-support (~> 3.11.0)
|
88
|
-
rspec-expectations (3.11.0)
|
89
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
90
|
-
rspec-support (~> 3.11.0)
|
91
|
-
rspec-mocks (3.11.0)
|
92
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
93
|
-
rspec-support (~> 3.11.0)
|
94
|
-
rspec-support (3.11.0)
|
95
|
-
rubocop (1.25.1)
|
96
|
-
parallel (~> 1.10)
|
97
|
-
parser (>= 3.1.0.0)
|
98
|
-
rainbow (>= 2.2.2, < 4.0)
|
99
|
-
regexp_parser (>= 1.8, < 3.0)
|
100
|
-
rexml
|
101
|
-
rubocop-ast (>= 1.15.1, < 2.0)
|
102
|
-
ruby-progressbar (~> 1.7)
|
103
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
104
|
-
rubocop-ast (1.16.0)
|
105
|
-
parser (>= 3.1.1.0)
|
106
|
-
rubocop-performance (1.13.2)
|
107
|
-
rubocop (>= 1.7.0, < 2.0)
|
108
|
-
rubocop-ast (>= 0.4.0)
|
109
|
-
ruby-progressbar (1.11.0)
|
110
|
-
simplecov (0.21.2)
|
111
|
-
docile (~> 1.1)
|
112
|
-
simplecov-html (~> 0.11)
|
113
|
-
simplecov_json_formatter (~> 0.1)
|
114
|
-
simplecov-html (0.12.3)
|
115
|
-
simplecov_json_formatter (0.1.4)
|
116
|
-
sqlite3 (1.3.13)
|
117
|
-
standard (1.7.2)
|
118
|
-
rubocop (= 1.25.1)
|
119
|
-
rubocop-performance (= 1.13.2)
|
120
|
-
thor (1.2.1)
|
121
|
-
thread_safe (0.3.6)
|
122
|
-
tzinfo (1.2.9)
|
123
|
-
thread_safe (~> 0.1)
|
124
|
-
unicode-display_width (2.1.0)
|
125
|
-
|
126
|
-
PLATFORMS
|
127
|
-
x86_64-linux
|
128
|
-
|
129
|
-
DEPENDENCIES
|
130
|
-
activerecord (~> 5.0.0)
|
131
|
-
appraisal (~> 2.4)
|
132
|
-
bundler (~> 2.1)
|
133
|
-
combustion (~> 1.3)
|
134
|
-
rake (~> 13.0)
|
135
|
-
rspec
|
136
|
-
rubocop (~> 1.25)
|
137
|
-
simplecov (~> 0.21)
|
138
|
-
sqlite3 (~> 1.3.6)
|
139
|
-
standard (~> 1.7)
|
140
|
-
unreliable!
|
141
|
-
|
142
|
-
BUNDLED WITH
|
143
|
-
2.3.8
|