Commit Graph

381 Commits

Author SHA1 Message Date
Gannon McGibbon
2e53c2b130 Add test retries for railties 2018-10-11 10:43:29 -04:00
Greg Molnar
84744b4c0d update nokogiri 2018-10-05 12:24:20 -07: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
utilum
bf8afe7a0f Update backburner to the latest version
version 1.5.0 includes to warning fixes that show on tests:
cd9670146b
4dfa22bda1
2018-09-28 13:14:14 +02:00
utilum
9951e69614 update mini_magick to the latest version
v 4.9.2 avoids some warnings that show in our tests.

Although Gemfile.lock currently specifies 4.8.0, the CI already runs 4.9.2
so 4.8.0 warnings do not show in our CI logs.
2018-09-24 09:50:44 +02:00
yuuji.yaginuma
a569a27fc7 Bump chromedriver-helper to 2.0 2018-09-16 09:18:12 +09: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
George Claghorn
a83509ffa5 Bump marcel for significant gem size reduction 2018-09-14 23:49:07 -04: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
Rafael Mendonça França
9ee5b28479
Upgrade all the gems 2018-09-05 17:41:31 -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
Kasper Timm Hansen
9136bb77a7
Merge pull request #33162 from utilum/stop_using_mocha
Stop using Mocha
2018-08-22 18:20:25 +02:00
utilum
c5fbfb8c12 Update image_processing to the latest version
Version 1.6.0 includes 3a958bc419 which saves us a warning: shadowing outer local variable - options.

I see it locally, but for some reason not on the CI.
2018-08-16 19:04:57 +02: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
Koichi ITO
211b10aea6 Bump RuboCop to 0.58.2
## Summary

RuboCop 0.58.2 was released.
https://github.com/rubocop-hq/rubocop/releases/tag/v0.58.2

And rubocop-0-58 channel is available in Code Climate.
https://github.com/codeclimate/codeclimate/releases/tag/v0.76.0
https://github.com/codeclimate/codeclimate/commit/38f21f0

In addition, the following changes are made in this PR.

- Replace Custom cops with Rails cops
- Add jaro_winkler gem to Gemfile.lock

### Replace Custom cops with Rails cops

These are compatible replacements.

- Replace `CustomCops/AssertNot` cop with `Rails/AssertNot` cop.
- Replace `CustomCops/RefuteNot` cop with `Rails/RefuteMethods` cop.

With this replacement, it was decided to use cop of RuboCop itself.
It removes the code related to CustomCops accordingly.

### Add jaro_winkler gem to Gemfile.lock

Since RuboCop 0.57.0 depends on jaro_winkler gem,
it has been added to Gemfile.lock.
2018-07-26 17:48:07 +09:00
utilum
cb68841b94 Update sprockets to Security release for CVE-2018-3760
See:

https://github.com/rails/sprockets/blob/v3.7.2/CHANGELOG.md
9c34fa0590
2018-06-27 07:34:05 +02:00
utilum
c739dcb6cc Update raabro to latest version
[v 1.1.6](https://github.com/floraison/raabro/blob/master/CHANGELOG.md#raabro-116--released-2018-06-22) fixes a warning we see on [Rails CI](https://travis-ci.org/rails/rails/jobs/395177524#L3763).
2018-06-23 23:23:54 +02:00
utilum
99685e39d2 Update fugit to latest version
[fugit 1.1.3](03a3ee86f3)
fixes warnings that show up in ActiveJob tests.

See [CI](https://travis-ci.org/rails/rails/jobs/394107740#L3764-L3778).
2018-06-21 12:11:43 +02:00
Rafael Mendonça França
16574409f8
Bundle update 2018-05-30 13:49:55 -04:00
utilum
acca10d8ef Update et-orbi to latest version
avoids `warning: assigned but unused variable - tu`.
2018-05-28 09:37:20 +02:00
Guillermo Iguaran
e10fd57e98 Bump minimum version of Thor to 0.19.0
Thor 0.18 is causing failures in all the generator tests.
2018-05-22 15:58:35 -05: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
Rafael França
f8a4bdd029
Merge pull request #32713 from utilum/max_ffi_version
Fix segmentation fault in EventedFileUpdateChecker
2018-04-25 00:59:45 -04:00
Matthew Draper
989b1cb4a3
Merge pull request #32097 from matthewd/arel
Merge Arel
2018-04-25 08:18:02 +09:30
utilum
0f9f836363 Fix segmentation fault in EventedFileUpdateChecker
resolves #32705
2018-04-24 20:54:52 +02:00
George Claghorn
ef5902a2f1
Merge pull request #32471 from janko-m/use-image_processing-gem
Use ImageProcessing gem for ActiveStorage variants
2018-04-23 16:01:16 -05:00
Bart de Water
e236454a1a Rubocop 0.54
Fix `.rubocop.yml: Lint/EndAlignment has the wrong namespace - should be Layout` warning
2018-04-21 13:18:50 -04: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
Rafael França
76c9498eb1
Merge pull request #32496 from yhirano55/fix_turbolinks_warning_in_railties
Fix turbolinks warning in railties test
2018-04-10 22:00:16 -04:00
Yoshiyuki Hirano
eebad82e7c Fix turbolinks warning in railties test
* Upgrade turbolinks from v5.0.1 to v5.1.0
* Fix warning in railties test

    lib/turbolinks/assertions.rb:17:
    warning: assigned but unused variable - visit_action
2018-04-11 10:08:38 +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
1cc282db7d Upgrade Mocha from v1.3.0 to v1.5.0
Mocha v1.5.0 is currently the latest release.
2018-04-07 12:26:27 +01:00
Rafael Mendonça França
e6f5e75ef1
Upgrade capybara to 3.0.1 to make sure our tests are passing 2018-04-06 17:09:14 -04:00
yuuji.yaginuma
0bfdd1da28 Fix broken ServerTest with Capybara 3.0.0
It seems that it is no longer possible to specify the value held by
`Capybara.server` as sever.

Ref: ba7674086c
2018-04-06 21:01:28 +09:00
Kasper Timm Hansen
0ec23effa7
Merge pull request #32065 from sikachu/move-SourceAnnotationExtractor-under-rails-namespec
Move SourceAnnotationExtractor under Rails module
2018-04-02 16:15:52 +02:00
Yuji Yaginuma
fe37da4ebf Bump rack-test to 1.0.0 2018-03-28 07:24:49 +09:00
Prem Sichanugrist
f2ebfcb0c0 Run bundle update on bootsnap
1.2.1 fixes a bug in `Kernel.require` and resolve a test failure.

See https://github.com/Shopify/bootsnap/pull/143
2018-03-23 01:09:24 +00:00
Ryuta Kamizono
958c5ad9e9 Fix test_config_another_database failure
Somehow `test_config_another_database` didn't fail on CI, but it will
fail locally.

https://travis-ci.org/rails/rails/jobs/356212950#L2474-L2482

```
% bundle exec ruby -w -Itest test/generators/app_generator_test.rb -n test_config_another_database
Run options: -n test_config_another_database --seed 7260

# Running:

F

Failure:
AppGeneratorTest#test_config_another_database [test/generators/app_generator_test.rb:417]:
Expected /^\s*gem\s+["']mysql2["'], '~> 0.4.4'$*/ to match "source 'https://rubygems.org'\ngit_source(:github) { |repo| \"https://github.com/\#{repo}.git\" }\n\nruby '2.5.0'\n\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\ngem 'rails', '~> 6.0.0.alpha'\n# Use mysql as the database for Active Record\ngem 'mysql2', '>= 0.4.4', '< 0.6.0'\n# Use Puma as the app server\ngem 'puma', '~> 3.11'\n# Use SCSS for stylesheets\ngem 'sass-rails', '~> 5.0'\n# Use Uglifier as compressor for JavaScript assets\ngem 'uglifier', '>= 1.3.0'\n# See https://github.com/rails/execjs#readme for more supported runtimes\n# gem 'mini_racer', platforms: :ruby\n\n# Use CoffeeScript for .coffee assets and views\ngem 'coffee-rails', '~> 4.2'\n# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks\ngem 'turbolinks', '~> 5'\n# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder\ngem 'jbuilder', '~> 2.5'\n# Use Redis adapter to run Action Cable in production\n# gem 'redis', '~> 4.0'\n# Use ActiveModel has_secure_password\n# gem 'bcrypt', '~> 3.1.7'\n\n# Use ActiveStorage variant\n# gem 'mini_magick', '~> 4.8'\n\n# Use Capistrano for deployment\n# gem 'capistrano-rails', group: :development\n\n# Reduces boot times through caching; required in config/boot.rb\ngem 'bootsnap', '>= 1.1.0', require: false\n\ngroup :development, :test do\n  # Call 'byebug' anywhere in the code to stop execution and get a debugger console\n  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]\nend\n\ngroup :development do\n  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.\n  gem 'web-console', '>= 3.3.0'\n  gem 'listen', '>= 3.0.5', '< 3.2'\n  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\n  gem 'spring'\n  gem 'spring-watcher-listen', '~> 2.0.0'\nend\n\ngroup :test do\n  # Adds support for Capybara system testing and selenium driver\n  gem 'capybara', '>= 2.15', '< 4.0'\n  gem 'selenium-webdriver'\n  # Easy installation and use of chromedriver to run system tests with Chrome\n  gem 'chromedriver-helper'\nend\n\n# Windows does not include zoneinfo files, so bundle the tzinfo-data gem\ngem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]\n".

bin/rails test test/generators/app_generator_test.rb:411

Finished in 0.174681s, 5.7247 runs/s, 34.3483 assertions/s.
1 runs, 6 assertions, 1 failures, 0 errors, 0 skips
```
2018-03-22 03:20:04 +09:00
Andrew White
627ef06331 Update loofah to mitigate CVE-2018-8048
See flavorjones/loofah#144
2018-03-21 16:48:47 +00: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
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
Yuji Yaginuma
a3b7aa66bc Update Gemfile.lock to reflect Capybara 3.x
Follow up of #32151
2018-03-06 11:57:49 +09: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