Commit Graph

665 Commits

Author SHA1 Message Date
George Claghorn
d415eb4f6d
Stop setting a default Capybara app host
It's intended not to be set if Capybara starts the app server itself. Base Rails-generated URLs off of Capybara.current_session.server_url instead.
2019-07-24 22:19:21 -04:00
John Hawthorn
5dbc814ddf Bump minimum selenium-webdriver version
Since #36424, we need an newer version in order to pass.
2019-07-04 16:17:39 -07:00
Ryuta Kamizono
648144649a
Merge pull request #36426 from abhaynikam/bump-codeclimate-rubocop-version
Bump rubocop to 0.71
2019-06-06 20:40:20 +09:00
Abhay Nikam
00b3b68602 Bump rubocop to 0.71 2019-06-06 15:34:50 +05:30
yuuji.yaginuma
a6154cf330 Unlock selenium-webdriver version
`selenium-webdriver` is deprecateing various features for improvement in 4.0.
I want to test with the latest version to check if Rails uses deprecated
features or not.
2019-06-06 13:34:20 +09:00
Prathamesh Sonpatki
fa0ce5c790
Bump bootsnap to a version with disables iseq_cache for Ruby 2.5
- Refs https://github.com/Shopify/bootsnap/pull/257
2019-04-26 12:55:28 +05:30
Koichi ITO
c6379fd27f Bump RuboCop to 0.67.2
Performance cops will be extracted from RuboCop to RuboCop Performance
when next RuboCop 0.68 will be released.
https://github.com/rubocop-hq/rubocop/issues/5977

RuboCop 0.67 is its transition period.

Since rails/rails repository uses Performance cops, This PR added
rubocop-performance gem to Gemfile.

And this PR fixes some offenses using the following auto-correct.

```console
% bundle exec rubocop -a

Offenses:

activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:212:26:
C: [Corrected] Layout/SpaceAroundOperators: Operator =
> should be surrounded by a single space.
              "primary"  => { adapter: "sqlite3", database: "db/primary.sqlite3" }
                         ^^
activerecord/test/cases/connection_adapters/connection_handlers_multi_db_test.rb:239:26:
C: [Corrected] Layout/SpaceAroundOperators: Operator => should be
surrounded by a single space.
              "primary"  => { adapter: "sqlite3", database: "db/primary.sqlite3" }
                         ^^
actionview/test/template/resolver_shared_tests.rb:1:1: C: [Corrected]
Style/FrozenStringLiteralComment: Missing magic comment #
frozen_string_literal: true.
module ResolverSharedTests
^
actionview/test/template/resolver_shared_tests.rb:10:33: C: [Corrected]
Layout/SpaceAroundEqualsInParameterDefault: Surrounding space missing in
default value assignment.
  def with_file(filename, source="File at #{filename}")
                                ^
actionview/test/template/resolver_shared_tests.rb:106:5: C: [Corrected]
Rails/RefuteMethods: Prefer assert_not_same over refute_same.
    refute_same a, b
    ^^^^^^^^^^^

2760 files inspected, 5 offenses detected, 5 offenses corrected
```
2019-04-16 17:58:24 +09:00
Fumiaki MATSUSHIMA
61c4be4777 Output junit format test report 2019-04-04 14:34:46 +09:00
Ryuta Kamizono
0908184e4c Use execute_batch2 rather than execute_batch to fix performance regression for fixture loading
d8d6bd5 makes fixture loading to bulk statements by using
`execute_batch` for sqlite3 adapter. But `execute_batch` is slower and
it caused the performance regression for fixture loading.

In sqlite3 1.4.0, it have new batch method `execute_batch2`. I've
confirmed `execute_batch2` is extremely faster than `execute_batch`.
So I think it is worth to upgrade sqlite3 to 1.4.0 to use that method.

Before:

```
% ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
Using sqlite3
Run options: -n test_eager_loading_too_may_ids --seed 35790

# Running:

.

Finished in 202.437406s, 0.0049 runs/s, 0.0049 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
ARCONN=sqlite3 bundle exec ruby -w -Itest  -n test_eager_loading_too_may_ids  142.57s user 60.83s system 98% cpu 3:27.08 total
```

After:

```
% ARCONN=sqlite3 bundle exec ruby -w -Itest test/cases/associations/eager_test.rb -n test_eager_loading_too_may_ids
Using sqlite3
Run options: -n test_eager_loading_too_may_ids --seed 16649

# Running:

.

Finished in 8.471032s, 0.1180 runs/s, 0.1180 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
ARCONN=sqlite3 bundle exec ruby -w -Itest  -n test_eager_loading_too_may_ids  10.71s user 1.36s system 95% cpu 12.672 total
```
2019-04-04 03:27:46 +09:00
Xavier Noria
379d7e8bfa bumps Zeitwerk and Bootsnap 2019-03-26 20:30:18 +01:00
Guillermo Iguaran
2512f24ef4 Use webdrivers instead of chromedriver-helper for AV UJS tests 2019-03-24 16:05:30 -05:00
Sharang Dashputre
c2de1f79ab Don't lock the webpacker gem by its patch version 2019-03-09 05:29:36 +05:30
Sharang Dashputre
8eaffa1945 Use the latest stable release of webpacker 2019-03-09 00:14:17 +05:30
Xavier Noria
c36b6c8d38 Let Zeitwerk be a dependency of Active Support
Zeitwerk is a strong dependency, planned to replace AS::Dependencies. A
line in the generated Gemfile does not convey this as much.
2019-02-13 12:27:53 -08:00
Xavier Noria
821d6c694c Zeitwerk integration 2019-02-12 02:28:04 -08:00
Sergey Ponomarev
2a29202288
Relax sqlite3 version dependency 2019-02-04 15:21:40 -05:00
Ryuta Kamizono
1cfa913948 Relax version locking of the selenium-webdriver
3.5.2 (September 07, 2017) is a little older.
2019-01-30 17:27:37 +09:00
Edouard CHIN
01a26e581f Implement a way to add browser capabilities:
* There is currently no way to define specific browser capabilities since our SystemTest driver override the `option` key [Ref](a07d068078/actionpack/lib/action_dispatch/system_testing/driver.rb (L35))
  This option key is used internally by selenium to add custom capabilities on the browser.

  Depending on the Browser, some option are allowed to be passed inside a hash, the driver takes care of setting whatever you passed on the driver option. An example [here](a07d068078/actionpack/lib/action_dispatch/system_testing/driver.rb (L35)) where you are allowed to pass args such as `--no-sandbox` etc
  However this behavior was only meant for backward compatibility and as you can see it's deprecated.
  The non-deprecated behavior is to create a `<Driver>::Option` object containing all the capabilities we want. This is what we [currently do](a07d068078/actionpack/lib/action_dispatch/system_testing/browser.rb (L34-L36)) when chrome or firefox are in headless mode.

  This PR allows to pass a block when calling `driven_by`, the block will be pased a `<Driver>::Option` instance. You can modify this object the way you want by adding any capabilities. The option object will be then passed to selenium.

  ```ruby
    driven_by :selenium, using: :chrome do |driver_option|
      driver_option.add_argument('--no-sandbox')
      driver_option.add_emulation(device: 'iphone 4')
    end
  ```
2019-01-29 08:50:29 -05:00
Lars Kanis
be838262e1 Switch queue_classic back to origin repository
It has been moved to the a fork as part of https://github.com/rails/rails/pull/31671 .
That was since to that time a required PR was not yet merged.
Now the queue_classic master branch is compatible to recent pg versions,
so that there's no need to keep using a fork.
2019-01-25 20:01:47 +01:00
Rafael Mendonça França
3219e4aef1
Use released webpacker 2019-01-17 17:21:09 -05:00
Matthew Draper
a796b993ad Switch to released rb-inotify 0.10.0
It contains guard/rb-inotify#79, which is what we were waiting for.
2018-12-31 00:38:05 +10:30
George Claghorn
a5b2fff64c Import Action Mailbox 2018-12-25 21:32:35 -05:00
Rafael Mendonça França
fa2cb55fda Upgrade thor to 0.20.1 2018-11-09 17:20:45 -05:00
George Claghorn
6b7eac5c51 Accept inbound emails from a variety of ingresses 2018-10-11 12:51:13 -04:00
Gannon McGibbon
2e53c2b130 Add test retries for railties 2018-10-11 10:43:29 -04:00
George Claghorn
96a4528560 Test against Rails master 2018-10-08 21:03:40 -04:00
yuuji.yaginuma
cab17ffe4e Remove unnecessary coffee-rails
Since we no longer use coffeescript in the generated files by
4838c1716a0340137d858fab49bf460e23be5a4b, this is no longer necessary.
2018-10-02 10:45:29 +09:00
David Heinemeier Hansson
4838c1716a
Make Webpacker the default JavaScript compiler for Rails 6 (#33079)
* Use Webpacker by default on new apps

* Stop including coffee-rails by default

* Drop using a js_compressor by default

* Drop extra test for coffeescript inclusion by default

* Stick with skip_javascript to signify skipping webpack

* Don't install a JS runtime by default any more

* app/javascript will be the new default directory for JS

* Make it clear that this is just for configuring the default Webpack framework setup now

* Start using the Webpack tag in the default layout

* Irrelevant test

* jQuery is long gone

* Stop having asset pipeline compile default application.js

* Add rails-ujs by default to the Webpack setup

* Add Active Storage JavaScript to application.js pack by default

* Consistent quoting

* Add Turbolinks to default pack

* Add Action Cable to default pack

Need some work on how to set the global consumer that channels will
work with. @javan?

* Require all channels by default and use a separate consumer stub

* Channel generator now targets Webpack style

* Update task docs to match new generator style

* Use uniform import style

* Drop the JS assets generator

It was barely helpful as it was. It’s no longer helpful in a Webpacked
world. Sayonara!

* Add app/javascript to the stats directories

* Simpler import style

Which match the other imports.

* Address test failures from dropping JS compilation (and compression)

* webpacker-default: Modify `AssetsGeneratorTest`

Before:

```
$ bin/test test/generators/assets_generator_test.rb
Run options: --seed 46201

F

Failure:
AssetsGeneratorTest#test_assets [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:12]:
Expected file "app/assets/javascripts/posts.js" to exist, but does not

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:10

.

Finished in 0.031343s, 63.8101 runs/s, 95.7152 assertions/s.
2 runs, 3 assertions, 1 failures, 0 errors, 0 skips
```

After:

```
$ bin/test test/generators/assets_generator_test.rb
Run options: --seed 43571

..

Finished in 0.030370s, 65.8545 runs/s, 65.8545 assertions/s.
2 runs, 2 assertions, 0 failures, 0 errors, 0 skips
```

* webpacker-default: Modify `ChannelGeneratorTest`

Before:

```
$ bin/test test/generators/channel_generator_test.rb
Run options: --seed 8986

.F

Failure:
ChannelGeneratorTest#test_channel_with_multiple_actions_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:43]:
Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:34

.F

Failure:
ChannelGeneratorTest#test_channel_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:29]:
Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:22

E

Error:
ChannelGeneratorTest#test_cable_js_is_created_if_not_present_already:
Errno::ENOENT: No such file or directory @ apply2files - /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/fixtures/tmp/app/assets/javascripts/cable.js

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:60

F

Failure:
ChannelGeneratorTest#test_channel_suffix_is_not_duplicated [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:87]:
Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:80

F

Failure:
ChannelGeneratorTest#test_channel_on_revoke [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:77]:
Expected file "app/assets/javascripts/cable.js" to exist, but does not

bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:68

Finished in 0.064384s, 108.7227 runs/s, 481.4861 assertions/s.
7 runs, 31 assertions, 4 failures, 1 errors, 0 skips
```

After:

```
$ bin/test test/generators/channel_generator_test.rb
Run options: --seed 44857

.......

Finished in 0.060243s, 116.1961 runs/s, 697.1764 assertions/s.
7 runs, 42 assertions, 0 failures, 0 errors, 0 skips
```

* Fix shared generator tests.

* webpacker-default: Modify `ControllerGeneratorTest`

The JS assets generator was dropped. ref. 46215b1794

* Revert "Simpler import style". It's currently failing with an error of "TypeError: undefined is not an object (evaluating '__WEBPACK_IMPORTED_MODULE_2_activestorage___default.a.start')". Waiting for @javan to have a look.

This reverts commit 5d3ebb71059f635d3756cbda4ab9752027e09256.

* require webpacker in test app

* Add webpacker without making the build hang/timeout. (#33640)

* use yarn workspaces to allow for installing unreleased packages and only generate js/bootsnap when required

* no longer need to have webpacker in env templates as webpacker moved this config to yml file

* Fix rubocop violation

* Got the test passing for the running scaffold

* update expected lines of code

* update middleware tests to account for webpacker

* disable js in plugins be default to get the tests passing (#34009)

* clear codeclimate report issues

* Anything newer than currently released is good

* Use Webpacker development version during development of Rails

* Edge should get development webpacker as well

* Add changelog entry for Webpacker change
2018-09-30 22:31:21 -07:00
David Heinemeier Hansson
4ab739a72a Skeleton 2018-09-17 16:30:33 -07:00
yuuji.yaginuma
d7445bc56f Unlock pg verson
Get a warning about `async_exec`, but it seems that build has passed
through the fix of be48d118ee.
2018-09-15 16:07:03 +09:00
Rafael França
62a0c30754
Merge pull request #33574 from lsylvester/change-i18n-defaults-behaviour-to-match-i18n-1.1.0
update I18n fallbacks configuration to be compatible with i18n 1.1.0
2018-09-06 14:38:26 -04:00
Rafael Mendonça França
f80722c0eb
Unlock ffi version
ffi has a security issue on versions before 1.9.24 so it is better to
upgrade even if that occasionally cause failures in some contributors
machines.
2018-09-05 17:56:57 -04:00
yuuji.yaginuma
58fc1ff8ef Avoid pg 1.1.0 for now
Because there are tests that fail due to the influence of the
`async_exec` deprecate message.
https://travis-ci.org/rails/rails/jobs/420345370

Related to #33188.
2018-08-25 17:15:07 +09:00
Lachlan Sylvester
66614f6b67 update I18n fallbacks configuration to be compatible with i18n 1.1.0 2018-08-23 06:56:42 +10:00
utilum
7d13e9de50 Remove Mocha from Gemfile
_Q.E.F._
2018-08-13 13:05:20 +02:00
Yasuo Honda
6c09b3adc9 Avoid i18n 1.1.0 for now
[Yasuo Honda & lsylvester]
2018-08-09 13:24:13 +00:00
George Claghorn
bf5f41d948
Support streaming downloads from Google Cloud Storage 2018-05-01 23:20:56 -04:00
utilum
f4eca1d630 Make Railties CI log for Ruby 2.6 accessible again
Pending the next release of Thor which [fixes](006832ea32) calls to `ERB.new`, Railties CI log for Ruby 2.6 is flooded with so many warnings it is too long for Travis to handle:

```
/home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
/home/travis/.rvm/gems/ruby-head/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:120: warning: Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.

The log length has exceeded the limit of 4 MB (this usually means that the test suite is raising the same exception over and over).

The job has been terminated
```

https://travis-ci.org/rails/rails/jobs/372623604#L10000
https://api.travis-ci.org/v3/job/372623604/log.txt

This patch forces installation of fixed Thor, and enables us to look at the the log.
2018-04-29 11:28:20 +02:00
utilum
0f9f836363 Fix segmentation fault in EventedFileUpdateChecker
resolves #32705
2018-04-24 20:54:52 +02:00
Janko Marohnić
ca12968587
Use ImageProcessing gem for ActiveStorage variants
ImageProcessing gem is a wrapper around MiniMagick and ruby-vips, and
implements an interface for common image resizing and processing. This
is the canonical image processing gem recommended in [Shrine], and
that's where it developed from. The initial implementation was extracted
from Refile, which also implements on-the-fly transformations.

Some features that ImageProcessing gem adds on top of MiniMagick:

  * resizing macros
    - #resize_to_limit
    - #resize_to_fit
    - #resize_to_fill
    - #resize_and_pad
  * automatic orientation
  * automatic thumbnail sharpening
  * avoids the complex and inefficient MiniMagick::Image class
  * will use "magick" instead of "convert" on ImageMagick 7

However, the biggest feature of the ImageProcessing gem is that it has
an alternative implementation that uses libvips. Libvips is an
alternative to ImageMagick that can process images very rapidly (we've
seen up 10x faster than ImageMagick).

What's great is that the ImageProcessing gem provides the same interface
for both implementations. The macros are named the same, and the libvips
implementation does auto orientation and thumbnail sharpening as well;
only the operations/options specific to ImageMagick/libvips differ. The
integration provided by this PR should work for both implementations.

The plan is to introduce the ImageProcessing backend in Rails 6.0 as the
default backend and deprecate the MiniMagick backend, then in Rails 6.1
remove the MiniMagick backend.
2018-04-18 17:46:25 +02:00
yuuji.yaginuma
5bca1f2167 Unlock dalli version
The issue was fixed with https://github.com/petergoldstein/dalli/pull/679,
and a new version containing that fix was released.
2018-04-11 16:52:10 +09:00
eileencodes
72f17d59e4 Remove upper bound on Capybara
There's no reason to block future versions of Capybara since we don't
_know_ they are going to break. How will we know if we have a
conservative option set? This change prevents us from blocking users who
want to upgrade in the future.
2018-04-10 16:40:14 -04:00
James Mead
364756c15c Simplify declaration of mocha dependency in Gemfile
The `require: false` option hasn't been needed since Mocha v1.0.
2018-04-07 12:18:33 +01:00
Rafael Mendonça França
fab6ded8f2
Allow any version of dalli less them 2.7.7 2018-03-20 11:58:14 -04:00
Alberto Almagro
6ef720791d Remove support for Qu gem.
Reasons are that the Qu gem wasn't compatible since Rails 5.1,
gem development was stopped in 2014 and maintainers have
confirmed its demise. See issue #32273
2018-03-19 21:27:16 +01:00
yuuji.yaginuma
63ec63ca8c Avoid dalli 2.7.7 for now
It's causing a test to fail.
Ref: https://travis-ci.org/rails/rails/jobs/353758855#L1433-L1501
2018-03-15 21:03:06 +09:00
Gaurav Sharma
875073a89d update psych gem to 3.2 stable release 2018-03-10 01:44:36 +05:30
Thomas Walpole
207536c063 Allow Capybara 3.x (#32151) 2018-03-05 17:44:39 -08:00
George Claghorn
ccac681122 Generate root-relative paths in Active Storage disk service URL methods
Fixes #32129.
2018-03-05 11:54:43 -05:00
Jeremy Daer
1e526788e6 Rails 6 requires Ruby 2.3+ 2018-02-17 10:03:37 -08:00