1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

19 commits

Author SHA1 Message Date
Jonathan Hefner
330becbdd0 Fix asset pipeline errors for plugin dummy apps
To fix #43920, f292daad70 added
`sprockets-rails` to the generated `Gemfile` for engine plugins because
their dummy apps use Sprockets.  However, non-engine plugins exhibit the
same issue because their dummy apps also use Sprockets.

This commit forces `skip_asset_pipeline` to be true when a plugin is not
an engine, and fixes several tests that failed to detect these issues
because they were accidentally using the `rails/rails` `Gemfile` instead
of the generated plugin `Gemfile`.
2022-01-05 15:50:43 -06:00
Jonathan Hefner
740e2044b1 Omit Rake test task from generated plugin
`bin/test` and `bin/rails test` are the preferred ways to run tests for
a plugin, so omit the Rake test task to avoid confusion.
2021-12-08 12:18:46 -06:00
David Heinemeier Hansson
af7428c4ac
Replace webpack with importmapped Hotwire as default js (#42999)
* Turbolinks is being replaced with Hotwire

* Make --webpack opt-in

* Don't use specific webpacker installers any more in preparation for next Webpacker

* Update railties/lib/rails/app_updater.rb

Co-authored-by: Alex Ghiculescu <alex@tanda.co>

* Trailing whitespace

* Convert to Turbo data attribute for tracking

* Default is no webpack, no hotwire

* Swap out turbolinks references for hotwire

* Drop explicit return

* Only generate package.json if using webpack

* Only create package.json in webpack mode

* Only create app/javascript in webpack mode

* Generate correct style/js links based on js mode

* Fix tests from changed output format

Not sure why these are showing up in this PR, though.

* Rubocopping

* Stick with webpack for the test app for now

* Adjust tests

* Replace minitest-reporters with minitest-ci (#43016)

minitest-reporters is used to create junit xml reports on CI.

But when it loads before rails minitest plugin makes
`Rails::TestUnitReporter` not being added as a reporter.

minitest-ci is now only loaded at ci and does not interferes with
rails minitest plugins. And keeps junit reports workings

* Too heavy handed to actually run bundle

Just like we don't auto-migrate

* Pin js frameworks in importmap

Instead of having importmap preconfigure it.

* Match updated app/javascript path

* No need for the explaining comment

* Fixes test cases for replace webpack with importmapped Hotwire as default js (#42999)

* Fix rubocop issues

* Fix more railities test cases

* Fix plugin generator railties shared test cases

* Fix Action Text install generator asset pipeline spec

* They're modules, not files

* Let dev use the latest release as well

So we don't have to replace unexisting dev releases with latest release

* Make Webpack responsible for generating all the JS files it needs

Webpacker 6 has already moved from app/javascript to app/packs.

* Don't add rails/ujs by default any longer

All the ajax/form functionality has been superseded by Turbo. The rest lives in a weird inbetween land we need to address through other means.

* Use new importmap location

* Switch to using turbo-rails and stimulus-rails directly

The hotwire-rails gem does not offer enough value for its indirection

* Use latest Webpacker

* Prevent version resolution requests from getting swallowed

* Use ESM syntax for imports

* Move management of yarn, package.json, etc to Webpacker 6

* Update for Webpacker 6

* Move bin/setup addition to Webpacker as well

* Remove dead tests

* Bump to Webpacker 6.0.0.rc.2

* No longer relevant given the new default is no webpacker

* Rely on Webpacker 6

* No longer relevant

* No longer relevant

* Make cable channel generator work for both webpacker and importmap setups

* Fix tests

* For tests testing importmap way

* Use Webpacker 6 dummy

* RuboCopping

* One more bump to fix webpack-dev-server

* Another bump. Hopefully the last one!

* Also enough to not want turbo tracking on

* Fix tests

* Latest

* Fix tests

* Fix more tests

* Fix tests

Co-authored-by: Alex Ghiculescu <alex@tanda.co>
Co-authored-by: André Luis Leal Cardoso Junior <andrehjr@gmail.com>
Co-authored-by: Abhay Nikam <nikam.abhay1@gmail.com>
Co-authored-by: Guillermo Iguaran <guilleiguaran@gmail.com>
2021-08-26 10:39:36 +02:00
David Heinemeier Hansson
3e0cdbeaf4
require, require_relative, load by double quotes (#38841)
* require, require_relative, load by double quotes

We're getting rid of all single quote usage, unless it serves a specific purpose, as per the general style guide.
2020-03-29 16:30:52 -07:00
bogdanvlviv
d5ad63766e
Remove redundant passing --skip-active-storage in test cases
These were added in #30101, after #31084 it became redundant.
2017-11-08 21:39:35 +00:00
bogdanvlviv
4a835aa323
Add --skip-active-storage and do so automatically when --skip-active-record is used
Closes #30102

Revert part 787fe90dc0

--skip-active-storage pass throughs `rails plugin new`

Add changelog entry about default initialization of Active Storage
2017-11-06 21:08:51 +00:00
yuuji.yaginuma
c31c705a6a Explicitly require test_unit/reporter in test helper
If the user used the `bin/test` to execute the test, this file is
automatically loaded, so require is unnecessary.
acea68de02/railties/lib/rails/plugin/test.rb (L4)

However, when using `rake test`, an explicit require is required because
the above file is not loaded.

Fixes #30516
2017-09-04 07:30:44 +09:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
yuuji.yaginuma
0348a9e4ae Fix test runner's output
Output changed due to specification change of `SummaryReporter#aggregated_results`
in minitest 5.10.2.
In my opinion, that should fix rails's test runner(proceeding with #29354).
However, we still need discussion and the fix itself is minor, so I think
that we can fix only the test first.
2017-07-30 09:38:12 +09:00
yuuji.yaginuma
4ed0f36689 add warnings option to test runner 2017-01-24 11:05:41 +09:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces 2016-10-29 01:17:49 -02:00
yuuji.yaginuma
1269795ae2 use active_support/testing/autorun in bin/test script
29f0fbd5db has changed that always call
`Minitest.autorun` in `active_support/testing/autorun`.

Therefore, when used directly `Minitest.run`, tests are performed twice.
2016-09-27 19:34:58 +09:00
Xavier Noria
783763bde9 applies new string literal convention in railties/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00
Yves Senn
218dc0a3d3 fix build broken by 07e422f58d. 2016-02-15 15:57:14 +01:00
Kasper Timm Hansen
be3d4c6ef6 Remove incomplete filter runs all tests in plugins.
Forgot to remove it, when I changed the expectations in 88881d2.
2016-01-18 22:10:26 +01:00
yuuji.yaginuma
4f8c36ab70 display detailed information in inline reporting
The errors message only was not displayed, as if it did not use the inline reporting,
modified to also information the method name and the like in error are displayed.

```
# before
Failed assertion, no message given.

bin/rails test test/models/user_test.rb:5
```

```
# after
Failure:
UserTest#test_the_truth:
Failed assertion, no message given.

bin/rails test test/models/user_test.rb:5
```
2015-12-21 07:48:53 +09:00
yuuji.yaginuma
e4e42d0b34 show relative path the rerun snippet of test runner in rails engine
Since the absolute path is not required to re-run the test,
modified so that unnecessary information is not displayed.

```ruby
# before
bin/rails test /path/to/blorgh/test/integration/navigation_test.rb:5

# after
bin/rails test test/integration/navigation_test.rb:5
```
2015-12-10 16:08:37 +09:00
Rafael Mendonça França
3c95352aa0 Mac OS X use /private as directory to temp file
Related with e62ddac05b
2015-12-04 01:57:33 -02:00
yuuji.yaginuma
8242bcfa3e add bin/test script to rails plugin 2015-11-28 07:20:29 +09:00