aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #17920 from ↵Yves Senn2015-04-271-0/+28
| | | | | | | | | | | | | | | calebthompson/dont-rely-on-environment-task-for-schema-load" This reverts commit 08ff4ccbbb3fb143a02e6752efb974a4bcfcd3bb, reversing changes made to 6c9ed6dbc62450cdb87559afd15798305e069146. Caused by #17920. Closes #19545. This patch introduced regressions because initializers were no longer loaded. Specifically missing inflections result in broken restores of the database.
* Revert "Merge pull request #19404 from dmathieu/remove_rack_env"Jeremy Kemper2015-03-201-0/+3
| | | | | | | Preserving RACK_ENV behavior. This reverts commit 7bdc7635b885e473f6a577264fd8efad1c02174f, reversing changes made to 45786be516e13d55a1fca9a4abaddd5781209103.
* don't fallback to RACK_ENV when RAILS_ENV is not presentDamien Mathieu2015-03-191-3/+0
|
* Created rake restart task.Hyonjee Joo2015-02-261-0/+31
| | | | | | Fixes #18876. Rake restart touches `tmp/restart.txt` to restart application on next request. Updated tests and documentation accordingly.
* `db:structure:load` and `db:schema:load` no longer purge the database.Yves Senn2014-12-181-0/+25
| | | | | | | | | | | | | | | | | Closes #17945 `db:test:prepare` still purges the database to always keep the test database in a consistent state. This patch introduces new problems with `db:schema:load`. Prior to the introduction of foreign-keys, we could run this file against a non-empty database. Since every `create_table` containted the `force: true` option, this would recreate tables when loading the schema. However with foreign-keys in place, `force: true` wont work anymore and the task will crash. /cc @schneems
* bring back `db:test:prepare`.Yves Senn2014-11-251-9/+0
| | | | | | | | | | | | | | | This reverts deprecations added in #13528. The task is brought back for two reasons: 1. Give plugins a way to hook into the test database initialization process 2. Give the user a way to force a test database synchronization While `test:prepare` is still a dependency of every test task, `db:test:prepare` no longer hooks into it. This means that `test:prepare` runs before the schema is synchronized. Plugins, which insert data can now hook into `db:test:prepare`. The automatic schema maintenance can't detect when a migration is rolled-back, modified and reapplied. In this case the user has to fall back to `db:test:prepare` to force the synchronization to happen.
* Revert "Replace String index juggling with Pathname goodness in ↵yuuji.yaginuma2014-11-021-0/+10
| | | | | | | | db:fixtures:load" This reverts commit 482fdad5ef8a73688b50bba3991dd4ef6f286edd. Fixes #17237.
* build fix, we have to reset the RACK_ENV as well.Yves Senn2014-09-041-2/+5
| | | | | This is a follow-up to ded17a4 to get the build passing on Travis. As Travis has `ENV["RACK_ENV"]` set to `test` we need to reset that as well.
* schema loading rake tasks maintain database connection for current env.Yves Senn2014-09-031-0/+26
| | | | | | | | | | [Joshua Cody & Yves Senn] Closes #16757. Prior to this patch schema loading rake tasks had the potential to leak a connection to a different database. This had side-effects when rake tasks operating on the current connection (like `db:seed`) were chained.
* Add a test for db:migrate:status to check missing file scenarioViktar Basharymau2014-06-271-0/+15
|
* Return a non zero code when db has never been setup on statusPaul B2014-05-071-1/+1
|
* Revise 'sqlite3:' URL handling for smoother upgradesMatthew Draper2014-04-031-2/+2
| | | | | | | | | | | | | | | | Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll change to the absolute-path interpretation in 4.2. The current "correct" spellings for in-memory, relative, and absolute URLs, respectively, are: sqlite3::memory: sqlite3:relative/path sqlite3:/full/path Substantially reverses/defers fbb79b517f3127ba620fedd01849f9628b78d6ce. Uncovered by @guilleiguaran while investigating #14495, though that sounds like a different issue.
* test for structure:dump without schema information table. refs eafec46Yves Senn2014-03-201-0/+12
| | | | This is a test case for the fix provided in eafec4694c5b37eff9d83b1188b8e331fa6027fa
* Remove some indirection in rake dbs testCarlos Antonio da Silva2014-03-201-34/+20
| | | | | Just pass in the expected database as argument rather than "caching" it in a hash and using the hash in the helper methods.
* Check if the output is empty rather than asserting for equalityCarlos Antonio da Silva2014-03-201-5/+4
| | | | Also fix indent of test block.
* Refactor assertion of line numbers matching 4 spacesCarlos Antonio da Silva2014-03-191-16/+4
|
* Move booting/loading tasks setup to the rake notes helper methodCarlos Antonio da Silva2014-03-191-15/+3
|
* Extract rake notes command and lines scan boilerplateCarlos Antonio da Silva2014-03-191-19/+14
| | | | Refactor to a reusable method.
* Remove extra space assertionCarlos Antonio da Silva2014-03-191-3/+2
| | | | | No need to check that each line contains an extra space, just matching the space in the regexp is enough to ensure that.
* Extract common setup for loading tasks in rake notes testsCarlos Antonio da Silva2014-03-191-29/+14
|
* Merge pull request #14379 from robertomiranda/rake-notes.configGuillermo Iguaran2014-03-171-14/+30
|\ | | | | Add Public Api for Register New Extensions for Rake Notes
| * Rake notes should picked up new Extensions registered in the ↵robertomiranda2014-03-171-3/+19
| | | | | | | | config/application.rb file
| * Fix Shadowing extensions variable in Register Annotation Exentsionsrobertomiranda2014-03-161-5/+5
| |
| * Supporting .ruby, .yml and .yaml Extension in Rake Notesrobertomiranda2014-03-141-1/+6
| |
| * Remove .scss, .sass, .less, .haml, .slim, coffee from Rake Notes. Now we ↵robertomiranda2014-03-141-13/+3
| | | | | | | | have an API for register it in the corresponding gems
| * Add Public Api for register new extensions for Rake Notesrobertomiranda2014-03-141-0/+5
| |
* | Fix assertionsCarlos Antonio da Silva2014-03-161-2/+2
|/
* remove railties changes. fixes #14054Aaron Patterson2014-02-141-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 96991e8e919edfb20cc4120bca4e36ed51175d57 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:29:24 2014 -0800 Revert "gems can be added or skipped from the template" This reverts commit 8beb42cfbc41753ae4dbb91e16abcd1fb7d00356. Conflicts: railties/lib/rails/generators/rails/app/app_generator.rb railties/test/generators/app_generator_test.rb commit 35599c0e657245ef14ac0f28c9189ad16acf40e6 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:26:53 2014 -0800 Revert "oops, template replay needs to happen after bundle. :orz:" This reverts commit 9104702be61253f9448ca070a22fc86bb4299555. Conflicts: railties/lib/rails/generators/rails/app/app_generator.rb commit f519c3902c313db8e906a49251c91643b8e6499e Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:25:51 2014 -0800 Revert "only ask for these ivars if the target responds to them" This reverts commit 656d412546cd97d5660c634c2a41c799d3f9e211. commit aa524a9428e3e4c45fe221f10a66a08efb827ab5 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:25:39 2014 -0800 Revert "refactor generator tests to use block form of Tempfile" This reverts commit 65251820ef0ab7f3cffb38130de3dd41af8d72be. commit 7d3740549fa4dfa62e3761f8d4bc6d6d441256e7 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:25:25 2014 -0800 Revert "add a more restricted codepath for templates fixes #13390" This reverts commit 2875b4a66e38e4333da887a4afbed33358999298. commit 525df0af1001918986cdfce59539fd2d52c4f32c Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Feb 14 11:25:11 2014 -0800 Revert "add a send so `apply` can be called. Fixes #13510" This reverts commit c5034d60dba0cd31a6a8c612ee35d63b8127793a.
* add a send so `apply` can be called. Fixes #13510Aaron Patterson2014-02-111-0/+32
| | | | | | | THIS IS A HUGE HACK. Thor does not allow us to define public methods without turning them in to "thor tasks". That means we cannot subclass the `apply` method and make it public, so we have to make the method private and call `send` on it.
* Add config to disable schema dump after migrationEmil Soman2014-02-061-0/+31
| | | | | | | | | * Add a config on Active Record named `dump_schema_after_migration` * Schema dump doesn't happen if the config is set to false * Set default value of the config to true * Set config in generated production environment file to false * Update configuration guide * Update CHANGELOG
* Use DATABASE_URL by defaultschneems2014-01-021-8/+1
| | | See https://github.com/rails/rails/pull/13463#issuecomment-31480799 for full conversation.
* Automatically maintain test database schemaJon Leighton2014-01-021-0/+9
| | | | | | | | | | | | | | * Move check from generated helper to test_help.rb, so that all applications can benefit * Rather than just raising when the test schema has pending migrations, try to load in the schema and only raise if there are pending migrations afterwards * Opt out of the check by setting config.active_record.maintain_test_schema = false * Deprecate db:test:* tasks. The test helper is now fully responsible for maintaining the test schema, so we don't need rake tasks for this. This is also a speed improvement since we're no longer reloading the test database on every call to "rake test".
* Adding missing requireRafael Mendonça França2014-01-021-0/+1
|
* Move default production database to URL sub keyschneems2014-01-011-1/+5
| | | | By using the URL sub key in the `database.yml` by default we are exposing the ability to set other attributes such as `pool` or `reap_frequency` without need of modifying the URL to contain non-connection specific information.
* fix 2.1.0 bug :(schneems2013-12-251-1/+1
|
* ensure environment is run before db:structure:loadschneems2013-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now `db:drop` depends on `load_config` since so when `db:drop` gets executed `load_config` gets run. `db:structure:load` depends on `[:environment, :load_config]`. So before it runs, it executes `environment` but because `load_config` has already executed it is skipped. Note `db:load_config` is "invoke"-d twice, but only "execute"-d once: ``` ** Invoke db:drop (first_time) ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:drop ** Invoke db:structure:load (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config ** Execute db:structure:load ``` The fix for this is making sure that the environment is run before any `load_config`: ``` ** Invoke environment (first_time) ** Execute environment ** Invoke db:drop (first_time) ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:drop ** Invoke db:structure:load (first_time) ** Invoke environment ** Invoke db:load_config ** Execute db:structure:load ```
* Partial fix of database url testsschneems2013-12-251-1/+4
| | | | | | | | Prior to #13463 when `DATABASE_URL` was set, Rails automagically used that value instead of the database.yml. There are tests in dbs_test that expect this to still be true. After that PR, `RAILS_DATABASE_URL` is expected to be read into the YAML file via ERB, this PR fixes that behavior. Note: this does not entirely fix the tests. It seems that `ActiveRecord::Tasks::DatabaseTasks.current_config` does not process the url string correctly (convert it into a hash), and ` ActiveRecord::Tasks::DatabaseTasks.structure_load(current_config, filename)` as well as other methods in `DatabaseTasks` expect a hash. It seems like we should involve the resolver somewhere in this process to correctly convert the database url, I do not know the best place for that /cc @josevalim
* using symbol instead of string in establish_connectionKuldeep Aggarwal2013-12-251-1/+1
|
* Use Full path to sqlite database in testsschneems2013-12-221-3/+3
|
* added test cases to find notes in a file with .builder extensionKuldeep Aggarwal2013-11-171-1/+3
|
* More Warnings removed for ruby trunkArun Agrawal2013-11-011-2/+2
| | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* fix build error caused by #11900.Yves Senn2013-08-151-1/+1
|
* Adding LESS to rake notesJosh Crowder2013-08-151-0/+2
|
* handle notes in *.sass filesYuri Artemev2013-07-081-1/+3
|
* Remove hard coded references to Active Record in railtiesJosé Valim2013-03-021-13/+0
|
* run the load_structure test in the test environmentTerence Lee2013-02-211-3/+10
|
* test DATABASE_URL without database.yml aroundTerence Lee2013-02-211-0/+2
|
* allow :dirs option for .enumerateBrian D. Burns2013-01-151-0/+39
| | | | | | Allows custom rake tasks to be defined using: SourceAnnotationExtractor.enumerate 'TODO|FIXME', dirs: %w(app lib), tag: true
* Introduce ./bin for your app's executables: bin/bundle, bin/rails, bin/rake. ↵Jeremy Kemper2013-01-061-6/+2
| | | | Executable scripts are versioned code like the rest of your app. To generate a stub for a bundled gem: 'bundle binstubs unicorn' and 'git add bin/unicorn'
* Fixes for PR [#8267]Marc-Andre Lafortune2012-12-221-2/+2
| | | | | | | | * Fix Migration#reversible by not using `transaction`. * Adapt mysql adapter to updated api for remove_column * Update test after aedcd683684d08eaf30623a4b48ce31a31426372