| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
`OracleAdapter`
|
|\
| |
| | |
Use plain assert in assert_changes to avoid MT6 refutes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Seeing the previously issued PRs about it, we can avoid the `nil`
comparisons that can happen in `assert_changes` by using plain `assert`
calls.
This is to avoid a deprecation warning about comparing `nil` values in
`assert_equal` for Minitest 5 and a crash in Minitest 6.
You can see the preparations done in [`assert_equal`][ae]. You can also
see that [`assert`][a] does not care about `nil`s.
[ae]: https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest/assertions.rb#L159-L188
[a]: https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest/assertions.rb#L131-L142
|
|\ \
| | |
| | | |
Fix typoes on ActionDispatch::HTTP::FilterParameters
|
| | | |
|
|\ \ \
| | | |
| | | | |
Correctly kill the server started with ujs test
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`Kernel.#spawn` execute command via the shell if contains shell
metacharacters in the command.
In that case, return value of `spawn` is pid of the shell, not the server.
Therefore, just killing the pid will leave the process of server.
In order to correctly kill the server, send a signal to the process
group, not the process.
|
|\ \ \ \
| | | | |
| | | | | |
Allow `ConcurrentTransactionTest` can run with Oracle enhanced adapter
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
returns true
Not only postgresql or mysql2 adapter, Oracle enhanced adapter
whose default isolation level is read commited, passes these two test cases.
`ConcurrentTransactionTest#test_transaction_per_thread`
`ConcurrentTransactionTest#test_transaction_isolation__read_committed`
```ruby
$ ARCONN=oracle bin/test test/cases/transactions_test.rb:961 -v
Using oracle
Run options: -v --seed 18865
ConcurrentTransactionTest#test_transaction_per_thread = 0.98 s = .
Finished in 1.061036s, 0.9425 runs/s, 5.6549 assertions/s.
1 runs, 6 assertions, 0 failures, 0 errors, 0 skips
```
```ruby
$ ARCONN=oracle bin/test test/cases/transactions_test.rb:979 -v
Using oracle
Run options: -v --seed 13341
ConcurrentTransactionTest#test_transaction_isolation__read_committed = 1.85 s = .
Finished in 1.928637s, 0.5185 runs/s, 10.3700 assertions/s.
1 runs, 20 assertions, 0 failures, 0 errors, 0 skips
$
```
Also, regardless it is a file based or memory based these tests could fail with SQLite3Adapter.
(Extra CR added to make lines shorter)
```ruby
$ ARCONN=sqlite3 bin/test test/cases/transactions_test.rb:961 -v
Using sqlite3
Run options: -v --seed 18815
ConcurrentTransactionTest#test_transaction_per_thread = /home/yahonda/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/statement.rb:108:in `step':
SQLite3::BusyException: database is locked: UPDATE "topics" SET "approved" = ?, "updated_at" = ? WHERE "topics"."id" = ? (ActiveRecord::StatementInvalid)
```
```ruby
$ ARCONN=sqlite3 bin/test test/cases/transactions_test.rb:979 -v
Using sqlite3
Run options: -v --seed 25520
ConcurrentTransactionTest#test_transaction_isolation__read_committed = 0.12 s = E
/home/yahonda/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/statement.rb:108:in `step':
SQLite3::BusyException: database is locked: UPDATE "developers" SET "salary" = ?, "updated_at" = ?, "updated_on" = ? WHERE "developers"."id" = ? (ActiveRecord::StatementInvalid)
```
|
|\ \ \ \
| | | | |
| | | | | |
Change output log about skipping instalation of Active Storage
|
| |/ / /
| | | |
| | | |
| | | | |
Using of "`" is preferable over "'" to express console command in output log
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
bogdanvlviv/remove-redundant-passing-skip-active-storage-in-test-cases
Remove redundant passing --skip-active-storage in test cases
|
|/ / /
| | |
| | |
| | | |
These were added in #30101, after #31084 it became redundant.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
`through_reflection` and `source_reflection` are used only in the class.
|
|\ \ \
| | | |
| | | | |
Use released `redis-namespace` instead of master version
|
| | | |
| | | |
| | | |
| | | | |
The `redis-namespace` 1.6.0 includes redis-rb 4.0 support.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
y-yagi/fix_output_of_select_tag_with_include_blank_true
Fix output of `select_tag` with `include_blank: true` [ci skip]
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
Since #24923, if use `select_tag` with `include_blank: true`, an empty
label is added.
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
y-yagi/do_not_run_active_storage_install_when_bundle_install_is_skipped
Do not run active storage install when bundle install is skipped
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Since isolation application is generated with the `--skip-gemfile`
option, so `active_storage:install` is not executed.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
In order to execute the `rails` command, need to run bundle install in
advance.
Therefore, if skipped bundle install, `rails` command may fail and
should not do it.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix comment in `check_class_collision` [ci skip]
|
| | | |
| | | |
| | | |
| | | | |
`ScaffoldBase` was changed to `ResourceHelpers` by 0efedf2.
|
|\ \ \ \
| |/ / /
|/| | | |
Prevent extra string allocations when no 'rel' arg passed
|
| |\ \ \ |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This allows us to prevent an extra string allocation when there is a rel
argument and performs better/within error of the key check for other
scenarios such as passing in rel: nil
```ruby
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update
your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "benchmark-ips"
gem "rails"
end
def allocate_count
GC.disable
before = ObjectSpace.count_objects
yield
after = ObjectSpace.count_objects
after.each { |k,v| after[k] = v - before[k] }
after[:T_HASH] -= 1 # probe effect - we created the before hash.
GC.enable
result = after.reject { |k,v| v == 0 }
GC.start
result
end
@hash = {}
def master_version
"#{@hash["rel"]} nofollow".lstrip
end
def key_version
if @hash.key?("rel")
"#{@hash["rel"]} nofollow".lstrip
else
"nofollow"
end
end
def present_version
if @hash["rel"].present?
"#{@hash["rel"]} nofollow"
else
"nofollow".freeze
end
end
def nil_version
if @hash["rel"].nil?
"nofollow".freeze
else
"#{@hash["rel"]} nofollow"
end
end
def blank_version
if @hash["rel"].blank?
"nofollow".freeze
else
"#{@hash["rel"]} nofollow"
end
end
def test
puts "master_version"
puts allocate_count { 1000.times { master_version } }
puts "key_version"
puts allocate_count { 1000.times { key_version } }
puts "present_version"
puts allocate_count { 1000.times { present_version } }
puts "nil_version"
puts allocate_count { 1000.times { nil_version } }
puts "blank_version"
puts allocate_count { 1000.times { blank_version } }
Benchmark.ips do |x|
x.report("master_version") { master_version }
x.report("key_version") { key_version }
x.report("present_version") { present_version }
x.report("nil_version") { nil_version }
x.report("blank_version") { blank_version }
x.compare!
end
end
puts 'no rel key'
test
puts 'rel key with real stuff'
@hash['rel'] = 'hi'.freeze
test
puts 'rel key with nil'
@hash['rel'] = nil
test
puts 'rel key with ""'
@hash['rel'] = ""
test
```
```
no rel key
master_version
{:FREE=>-2818, :T_STRING=>3052}
key_version
{:FREE=>-1}
present_version
{:FREE=>-1}
nil_version
{:FREE=>-1}
blank_version
{:FREE=>-1}
Warming up --------------------------------------
master_version 124.677k i/100ms
key_version 227.992k i/100ms
present_version 208.068k i/100ms
nil_version 235.272k i/100ms
blank_version 176.274k i/100ms
Calculating -------------------------------------
master_version 1.968M (±10.8%) i/s - 9.725M in 5.010763s
key_version 7.734M (±11.2%) i/s - 38.075M in 5.001613s
present_version 5.688M (±11.4%) i/s - 28.089M in 5.019560s
nil_version 6.965M (±10.2%) i/s - 34.585M in 5.024806s
blank_version 6.139M (±18.7%) i/s - 29.085M in 5.010919s
Comparison:
key_version: 7734058.3 i/s
nil_version: 6965050.2 i/s - same-ish: difference falls within error
blank_version: 6138744.3 i/s - same-ish: difference falls within error
present_version: 5688248.4 i/s - 1.36x slower
master_version: 1967932.3 i/s - 3.93x slower
rel key with real stuff
master_version
{:FREE=>-2001, :T_STRING=>2000}
key_version
{:FREE=>-2001, :T_STRING=>2000}
present_version
{:FREE=>-1001, :T_STRING=>1000}
nil_version
{:FREE=>-1002, :T_STRING=>1000, :T_IMEMO=>1}
blank_version
{:FREE=>-1001, :T_STRING=>1000}
Warming up --------------------------------------
master_version 93.351k i/100ms
key_version 89.747k i/100ms
present_version 91.963k i/100ms
nil_version 103.370k i/100ms
blank_version 74.845k i/100ms
Calculating -------------------------------------
master_version 2.179M (±21.4%) i/s - 10.362M in 5.044668s
key_version 2.345M (± 9.8%) i/s - 11.667M in 5.030982s
present_version 1.738M (±14.8%) i/s - 8.553M in 5.056406s
nil_version 2.485M (±19.1%) i/s - 11.888M in 5.015940s
blank_version 1.951M (±12.3%) i/s - 9.580M in 5.011932s
Comparison:
nil_version: 2484704.1 i/s
key_version: 2344664.8 i/s - same-ish: difference falls within error
master_version: 2178975.8 i/s - same-ish: difference falls within error
blank_version: 1950532.0 i/s - same-ish: difference falls within error
present_version: 1737866.7 i/s - 1.43x slower
rel key with nil
master_version
{:FREE=>-3001, :T_STRING=>3000}
key_version
{:FREE=>-3001, :T_STRING=>3000}
present_version
{:FREE=>-1}
nil_version
{:FREE=>-1}
blank_version
{:FREE=>-1}
Warming up --------------------------------------
master_version 112.655k i/100ms
key_version 105.048k i/100ms
present_version 136.219k i/100ms
nil_version 192.026k i/100ms
blank_version 184.846k i/100ms
Calculating -------------------------------------
master_version 1.893M (±12.6%) i/s - 9.238M in 5.002621s
key_version 1.672M (±13.5%) i/s - 8.194M in 5.021197s
present_version 4.484M (±20.5%) i/s - 21.114M in 5.002982s
nil_version 5.294M (±18.1%) i/s - 25.155M in 5.020721s
blank_version 5.588M (± 6.7%) i/s - 27.912M in 5.019305s
Comparison:
blank_version: 5588489.6 i/s
nil_version: 5293929.9 i/s - same-ish: difference falls within error
present_version: 4484493.7 i/s - same-ish: difference falls within error
master_version: 1892919.0 i/s - 2.95x slower
key_version: 1672343.9 i/s - 3.34x slower
rel key with ""
master_version
{:FREE=>-2001, :T_STRING=>2000}
key_version
{:FREE=>-2001, :T_STRING=>2000}
present_version
{:FREE=>-1}
nil_version
{:FREE=>-1001, :T_STRING=>1000}
blank_version
{:FREE=>-1}
Warming up --------------------------------------
master_version 140.499k i/100ms
key_version 124.738k i/100ms
present_version 186.659k i/100ms
nil_version 148.063k i/100ms
blank_version 178.707k i/100ms
Calculating -------------------------------------
master_version 1.826M (±24.2%) i/s - 8.289M in 5.026603s
key_version 1.561M (±15.3%) i/s - 7.609M in 5.005662s
present_version 3.622M (±19.9%) i/s - 17.173M in 5.042217s
nil_version 2.438M (±11.5%) i/s - 12.141M in 5.053335s
blank_version 4.911M (±15.5%) i/s - 23.768M in 5.009106s
Comparison:
blank_version: 4910741.1 i/s
present_version: 3622183.5 i/s - same-ish: difference falls within error
nil_version: 2437606.2 i/s - 2.01x slower
master_version: 1825652.2 i/s - 2.69x slower
key_version: 1560530.5 i/s - 3.15x slower
```
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Do a check if the 'rel' argument is passed in, and simply set it to
'nofollow' if 'rel' was not passed in. This prevents three string
allocations for each call to `link_to` in that scenario. In the scenario
where the 'rel' argument is passed in, performance is around the same as
before as the `key?` check is very fast.
```ruby
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update
your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "benchmark-ips"
gem "rails"
end
def allocate_count
GC.disable
before = ObjectSpace.count_objects
yield
after = ObjectSpace.count_objects
after.each { |k,v| after[k] = v - before[k] }
after[:T_HASH] -= 1 # probe effect - we created the before hash.
GC.enable
result = after.reject { |k,v| v == 0 }
GC.start
result
end
@hash = {}
def master_version
"#{@hash['rel'.freeze]} nofollow".lstrip
end
def fast_version
if @hash.key?('rel'.freeze)
"#{@hash["rel"]} nofollow".lstrip
else
"nofollow".freeze
end
end
puts 'no rel key'
puts "master_version"
puts allocate_count { 1000.times { master_version } }
puts "fast_version"
puts allocate_count { 1000.times { fast_version } }
Benchmark.ips do |x|
x.report("master_version") { master_version }
x.report("fast_version") { fast_version }
x.compare!
end
puts 'rel key'
@hash['rel'] = 'hi'.freeze
puts "master_version"
puts allocate_count { 1000.times { master_version } }
puts "fast_version"
puts allocate_count { 1000.times { fast_version } }
Benchmark.ips do |x|
x.report("master_version") { master_version }
x.report("fast_version") { fast_version }
x.compare!
end
```
```
no rel key
master_version
{:FREE=>-2791, :T_STRING=>3052}
fast_version
{:FREE=>-1}
Warming up --------------------------------------
master_version 80.324k i/100ms
fast_version 200.262k i/100ms
Calculating -------------------------------------
master_version 2.049M (±11.9%) i/s - 10.121M in 5.025613s
fast_version 6.645M (±21.3%) i/s - 29.439M in 5.007488s
Comparison:
fast_version: 6644506.3 i/s
master_version: 2048833.0 i/s - 3.24x slower
rel key
master_version
{:FREE=>-2001, :T_STRING=>2000}
fast_version
{:FREE=>-2001, :T_STRING=>2000}
Warming up --------------------------------------
master_version 155.673k i/100ms
fast_version 106.515k i/100ms
Calculating -------------------------------------
master_version 2.652M (±20.4%) i/s - 12.610M in 5.036494s
fast_version 2.237M (±16.8%) i/s - 10.865M in 5.035366s
Comparison:
master_version: 2651702.2 i/s
fast_version: 2237470.6 i/s - same-ish: difference falls within error
```
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
bogdanvlviv/test-if-unless-options-for-validations
Add cases to test combining validation conditions
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Test condition that is defined by array of conditions
- Test condition that is defined by combining :if and :unless
- Test local condition that is defined by :if
- Test local condition that is defined by :unless
See http://edgeguides.rubyonrails.org/active_record_validations.html#combining-validation-conditions
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix `bin/rails db:migrate` with specified `VERSION`
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Ensure that `bin/rails db:migrate` with specified `VERSION` reverts
all migrations only if `VERSION` is `0`.
Raise error if target migration doesn't exist.
|
| | | | | | |
| | | | | | |
| | | | | | | |
Closes #31073.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
`associated_records_by_owner` had returned customizing result before
calling `associate_records_to_owner` for through association subclasses.
Since #22115, `associate_records_to_owner` is called in the method and
not returned owner and result pairs. Removing the method will reduce
method call and block call nesting.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
bogdanvlviv/ConfirmationValidator-with_false_value
Execute `ConfirmationValidator` validation when `_confirmation`'s value is `false`
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
`false`
|
| |/ / / / / /
|/| | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Provide initialization of Active Storage
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
new`
|
| | | | | | | | |
|