Commit Graph

10051 Commits

Author SHA1 Message Date
Rafael Mendonça França
07ae138386 Merge pull request #17292 from tricknotes/generator-test-doc
Fix example code for `Rails::Generators::Testing::Behaviour` [ci skip]
2014-10-16 17:04:01 -03:00
Ryunosuke SATO
101fbdba4c Fix example code for Rails::Generators::Testing::Behaviour [ci skip]
`cleanup_destination_root` method is not found anywhere.
Instead, `prepare_destination` clean up distination root on setup.
2014-10-17 04:57:36 +09:00
Rafael Mendonça França
be5521eb4e Use released rails-dom-testing 2014-10-16 16:53:46 -03:00
Yves Senn
ee787d9f58 test, Generators::GeneratedAttribute with references, required, index.
Closes #17197.
Closes #17207.

`{required}` is a type modifier so it should be:

    user:references{required}:index

and not:

    user:references:index{required}
2014-10-16 15:50:13 +02:00
Yves Senn
1a76ab8d42 Merge pull request #17278 from velobuff/clarify-debugger-invocation
clarify debugger platform invocation
2014-10-16 13:13:26 +02:00
Yves Senn
400b0818fa some changelog formatting. [ci skip] 2014-10-16 09:11:41 +02:00
Yves Senn
aaafbaf546 Merge pull request #17280 from aditya-kapoor/remove-unneeded-file
remove unneeded file from Railties.
2014-10-16 09:00:06 +02:00
Aditya Kapoor
f551a046df remove unneeded file 2014-10-16 12:05:01 +05:30
Aditya Kapoor
ce086b22e7 use require_command! instead of calling its definition 2014-10-16 11:05:58 +05:30
Raman Sinha
db41cc252c clarify debugger platform invocation 2014-10-15 19:04:02 -06:00
Rafael Mendonça França
733996cce1 Don't need to account turbolinks cookies in get request.
It was changed to not set the cookie in get requests at
62cc3db457.

Related with dcb05f26.
2014-10-13 17:24:44 -03:00
Rafael Mendonça França
f919d5f5ea Merge pull request #17240 from masarakki/fix-test_helper-of-mountable-plugin
fix test_helper for mountable plugin
2014-10-13 10:33:13 -03:00
masarakki
a441293cd9 fix test_helper for mountable plugin 2014-10-13 22:17:50 +09:00
Erik Michaels-Ober
8bb33e920a Replace Enumerable#reverse.each with Enumerable#reverse_each 2014-10-13 11:47:16 +01:00
Joshua Peek
fa5a1b9345 Default generated Gemfile to coffee-rails ~> 4.1.0 2014-10-12 18:27:27 -07:00
Rafael Mendonça França
7b740f31cc Merge pull request #17088 from robin850/jruby-dev
Follow up to #16613
2014-10-01 22:56:08 -03:00
Rafael Mendonça França
098158c38f Generate the application pointing to rails-dom-testing master
It is temporary until we do the final release
2014-09-30 13:42:55 -03:00
Abdelkader Boudih
175ca453a3 correct filename for jobs tests 2014-09-28 10:31:17 +00:00
Robin Dupret
1fac7b79f3 Follow up to #16613
Since we want this flag to be enabled anytime we are running the tests
under JRuby, let's enable this at the Rakefile level so people get the
performance boost on their local checkout.

Moreover, we avoid having to update this particular line anytime the
option changes on the JRuby side.

The only drawback is that we have to define it in every Rakefile but
there's no big deal, this is already the case for other options.
2014-09-28 12:04:06 +02:00
Jeremy Kemper
e1e8e532ac Merge pull request #17077 from schneems/schneems/backtrace-string-allocations
Decrease backtrace cleaner object allocations
2014-09-27 20:03:35 -07:00
Richard Schneeman
dfbcfafd9a Move object allocation out of loop
Right now BenchmarkCleaner allocates hundreds of strings on every request with an exception. This patch moves those strings to be generated at boot once and re-used.

## Bench Methods

I took a modified form of CodeTriage https://github.com/schneems/codetriage-ko1-test-app/blob/master/perf.rake and ran given rake tasks with and without the patch to BacktraceCleaner.

I made an endpoint results in exception

```
  def index
    raise “foo"
  end
```

The gem `memory_profiler` was used to capture objects allocated for a single request. Then `benchmark/ips` was used to test the speed of the patch.

You will see that we use less objects and the code becomes measurably faster with this patch.

## With patch:

Memory for one request:

```
Total allocated 7441
Total retained 37
```

Requests per second:


```
Calculating -------------------------------------
                 ips         4 i/100ms
-------------------------------------------------
                 ips       43.0 (±4.7%) i/s -        216 in   5.037733s
```


## Without patch:

Memory used for one request:


```
Total allocated 11599
Total retained 35 
```

Requests per second:

```
Calculating -------------------------------------
                 ips         3 i/100ms
-------------------------------------------------
                 ips       39.4 (±7.6%) i/s -        198 in   5.052783s
```

## Analysis

The patch is faster:

```
(43.0 - 39.4 ) / 39.4 * 100
# => 9 # % ~ speed bump
```

It also allocates less objects:

```
11599 - 7441
# => 4158
```

These strings are allocated on __EVERY SINGLE REQUEST__. This patch saves us 4158 objects __PER REQUEST__ with exception.

Faster errors == Faster applications
2014-09-27 13:42:20 +08:00
Rafael Mendonça França
4581d04477 Preparing for 4.2.0.beta2 release 2014-09-26 17:19:53 -03:00
Byron Bischoff
fe1b02d5ac remove extra # in css 2014-09-25 13:53:45 -07:00
Rafael Mendonça França
80990e2a0b rails-html-sanitizer is now the default
Also add to upgrading guide a notice about the deprecated sanitizers
2014-09-25 16:45:45 -03:00
Rafael Mendonça França
64fc8963b9 Remove unused code 2014-09-25 16:20:31 -03:00
Rafael Mendonça França
2922f63039 💅 the CSS 2014-09-25 16:09:43 -03:00
Rafael Mendonça França
89307fe2ce Merge pull request #17024 from buddhamagnet/amend-welcome-page
Amend welcome page
2014-09-25 16:07:19 -03:00
Godfrey Chan
b008e4bd8a Use released rails-html-sanitizer and rails-deprecated_sanitizer 2014-09-26 01:37:05 +09:00
buddhamagnet
be0206e4e2 Improve welcome page css and table cell aignments. 2014-09-25 11:59:13 -04:00
Rafael Mendonça França
478ad3f930 Use release web-console 2014-09-25 12:35:06 -03:00
Dan Olson
8e9bc11d22 Remove --skip-action-view option from application generator 2014-09-24 10:25:59 -05:00
Grzesiek Kolodziejczyk
95e3e42b87 Fix loading fixtures in engine tests
fixture_path is a class attribute of ActiveSupport::TestCase, so
ActiveSupport::TestCase.method_defined?(:fixture_path=) would always
return false.

This should fix #4971
2014-09-23 11:50:10 +02:00
Yuki Nishijima
f8e26c8014 Fix another false assertions
* The assertions in AS::Duration don't actually assert.
 * The assertion in Railtie will pass even when `eager_load_namespaces`
   doesn't include `AppTemplate::Application` if `Rails.application` is
   truthy.

For more details, see here:

 * https://github.com/rails/rails/pull/16998
 * https://github.com/rails/rails/pull/17000
2014-09-21 17:16:21 -07:00
Godfrey Chan
3e27a03fe4 Merge pull request #16984 from chancancode/fix_16578
Document that the default for `rails server -b` has changed
2014-09-22 01:08:19 +09:00
Godfrey Chan
5919cce0de Document that the default for rails server -b has changed
Fixes #16578
2014-09-22 01:04:42 +09:00
Tamir Duberstein
994d3ebe9b Standardize on Rails.application [ci skip]
This seems to be the style settled on in most of the templates.
2014-09-19 10:42:58 -07:00
Rafael Mendonça França
c2dfc31691 Merge pull request #16936 from untidy-hair/plugin_test_db_migrate_path
Specify dummy app's db migrate path in plugin's test_helper.rb

Conflicts:
	railties/CHANGELOG.md
2014-09-18 18:39:44 -03:00
Xavier Noria
112077c255 inject Rack::Lock if config.eager_load is false
If code is not eager loaded constants are loaded on demand. Constant
autoloading is not thread-safe, so if eager loading is not enabled
multi-threading should not be allowed.

This showed up in certain Capybara scenarios: Most Capybara drivers
other than Rack::Test need a web server. In particular, drivers for
JavaScript support. Capybara launches WEBrick in its own thread for
those but that per se is fine, because the spec thread and the server
thread are coordinated.

Problem comes if the page being served in the spec makes Ajax calls.
Those may hit WEBrick in parallel, and since WEBrick is multi-threaded
and allow_concurrency? returns true in the test environment before
this patch, threads are spawned to serve those parallel requests. On
the other hand, since eager_load is false by default in the test
environment, constants are not preloaded.

So the suite is autoloading constants in a multi-threaded set. That's
a receipt for paracetamol. The symptom is random obscure errors whose
messages point somehow to constant autoloading.

As a consequence of this fix for allow_concurrency? WEBrick in
Capybara scenarios no longer runs in multi-threaded mode.

Fixes #15089.
2014-09-18 23:04:08 +02:00
Yukio Mizuta
7137c6b775 Specify dummy app's db migrate path in plugin's test_helper.rb 2014-09-16 20:21:17 -07:00
Thibault Jouan
c9213e1033 Improve environment config templates consistency:
* Fix long lines;
* Use simple quotes for string literals when interpolation is not used.
2014-09-16 16:07:59 -03:00
Rafael Mendonça França
6e4aa9d5ea Merge pull request #16914 from untidy-hair/fix_plugin_dummy_path_error
Use dynamic path for dummy app location in plugin's test_helper.rb
2014-09-16 10:51:29 -03:00
yuuji.yaginuma
14f07fdc07 Add test:jobs task 2014-09-15 09:43:02 +09:00
Yukio Mizuta
8c9b347342 Use dynamic path for dummy app location in plugin's test_helper.rb 2014-09-14 10:55:19 -07:00
yuuji.yaginuma
b3c9d3e6fa Change ActiveJob test directory to "test/jobs" 2014-09-13 12:54:55 +09:00
Rafael Mendonça França
1245a9e06c Always define capture to remove the deprecation message 2014-09-11 00:55:05 -03:00
Rafael Mendonça França
53e877f7d9 Define the configuration at Active Support 2014-09-11 00:54:43 -03:00
Rafael Mendonça França
8edb5eeb36 Set test order in ActiveSupport::TestCase of isolation/abstract_unit 2014-09-10 22:42:15 -03:00
Rafael Mendonça França
e4c529ea1d Set the test order to be random in the generated app
This will avoid the warning in our tests. We delete all the
config/environments/ files in the test app so our default code will not
work.
2014-09-10 22:34:55 -03:00
Rafael Mendonça França
412f651665 Merge pull request #16839 from chancancode/default_test_order
Default to sorting user's test cases for now
2014-09-10 22:34:06 -03:00
Akira Matsuda
ed9d220cd1 Tell the user which file is missing when config/database.yml was not found
Since cc03675d30b58e28f585720dad14e947a57ff5b the error message became like
"Could not load database configuration. No such file -"
which doesn't really tell what's actually missing.
2014-09-10 19:25:01 +09:00