aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/tasks
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #20569 from theSteveMitchell/masterYves Senn2015-09-221-6/+8
|\ | | | | | | Check mysql structure_load for errors
| * Check response of structure_load for mysql_database_tasks and make ↵Steve Mitchell2015-09-181-3/+16
|/ | | | structure_dump consistent
* Allow global migrations_path configuration with using value from ↵Tobias Bielohlawek2015-09-071-1/+3
| | | | database_tasks instead of Migrator
* Add run_cmd class method to ActiveRecord::Tasks::DatabaseTasksstarbelly2015-08-011-6/+6
| | | | | | | | | | - Added run_cmd() class method to dry up Kernel.system() messages within this namespace and avoid shell expansion by passing a list of arguments instead of a string - Update structure_dump, structure_load, and related tests units to pass a list of params instead of using a string to avoid shell expansion
* Changed mysqldump to include sprocs and functionsJonathan Worek2015-05-221-4/+4
|
* Add full set of MySQL CLI options to support SSL authentication when using ↵Alex Coomans2015-05-121-1/+10
| | | | db:structure dump and load
* Merge pull request #19503 from jasoncodes/no-psqlrcYves Senn2015-03-251-2/+2
| | | | Avoid loading user's psqlrc when loading test structure
* Add config.active_record.dump_schemas.Ryan Wallace2015-03-171-6/+39
| | | | | | | Fixes db:structure:dump when using schema_search_path and PostgreSQL extensions. Closes #17157.
* Fixes reference for schema_format to AR::Base from AS::BaseJames Cox2015-03-031-0/+16
|
* schema loading rake tasks maintain database connection for current env.Yves Senn2014-09-031-0/+1
| | | | | | | | | | [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 ActiveRecord::Tasks::DatabaseTasks.migrateJack Danger Canty2014-07-311-0/+13
| | | | | | This extracts the logic that was embedded in a Rake task into a static method. Bonus: the first test for `rake db:migrate`
* tests, run adapter specific rake tests only for the right adapter.Yves Senn2014-07-243-0/+6
|
* build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6Yves Senn2014-07-241-2/+2
| | | | | | | | | | | | | | Fixes the following issue: 1) Failure: ActiveRecord::MySQLPurgeTest#test_establishes_connection_to_test_database [test/cases/tasks/mysql_rake_test.rb:200]: not all expectations were satisfied unsatisfied expectations: - expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection(:test) satisfied expectations: - allowed any number of times, invoked once: #<Mock:0x2349430>.recreate_database(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.establish_connection(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.connection(any_parameters)
* Active Record tests still depend on `capture`. Let's keep it for now.Yves Senn2014-07-161-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 3121412 /cc @rafaelfranca This will remove deprecation warnings from the PostgreSQL suite: ``` DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89) /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun' ```
* Keep quietly and capture undeprecated on your suiteRafael Mendonça França2014-07-151-0/+19
|
* add `bin/rake db:purge` task to empty the current database.Yves Senn2014-06-171-0/+28
|
* fix typo in test method names. [ci skip]Yves Senn2014-06-171-4/+4
|
* create/drop test and development databases only if RAILS_ENV is nilDamien Mathieu2014-01-081-2/+24
| | | | Closes #13625
* Fix failure introduced from #13488schneems2013-12-251-1/+1
|
* require the files we testAaron Patterson2013-11-251-0/+1
|
* Revert "Properly require database tasks so we have access to the raised ↵Rafael Mendonça França2013-11-193-3/+0
| | | | | | | | constant" This reverts commit fbcd46b1a0d255a34d29caa77bbd31c287446333. This is not needed anymore. See 7280965
* Revert "Explicitly exit with status "1" for create and drop failures"Rafael Mendonça França2013-11-193-18/+6
| | | | | | | | | | This reverts commit 22f80ae57b26907f662b7fd50a7270a6381e527e. See https://github.com/rails/rails/commit/22f80ae57b26907f662b7fd50a7270a6381e527e#commitcomment-4640676 Conflicts: activerecord/CHANGELOG.md
* Properly require database tasks so we have access to the raised constantCarlos Antonio da Silva2013-11-173-0/+3
| | | | Fix travis failures.
* Merge pull request #12531 from iamvery/database-tasks-exit-statusRafael Mendonça França2013-11-153-6/+18
|\ | | | | | | | | | | | | Explicitly exit with status "1" for create and drop task failures Conflicts: activerecord/CHANGELOG.md
| * Explicitly exit with status "1" for create and drop failuresJay Hayes2013-11-113-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A non-zero exit status allows subsequent shell commands to be chained together such as: `rake db:reset test:prepare && rspec && cap deploy` (if you're feeling brave :) * Any exceptions raised during the `create` and `drop` tasks are caught in order to print a "pretty" message to the user. Unfortunately doing so prevents rake from aborting with a non-zero exit status to the shell. * Therefore we re-raise the exceptions after the "pretty" message and re-catch them in the task. * From the task we explicitly exit with a non-zero status. This method was chosen (rather than just letting rake fail from the exception) so that the backtrace is suppressed and the output to stderr is unchanged. * Update activerecord CHANGELOG
* | Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-75/+74
| | | | | | | | | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* | More Warnings removed for ruby trunkArun Agrawal2013-11-011-1/+1
| | | | | | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* | Warnings removed for ruby trunkArun Agrawal2013-11-011-3/+3
| | | | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* | Fix loading a sql structure file on postgres when the file's path has ↵Kevin Mook2013-10-211-0/+7
| | | | | | | | whitespace in it
* | Convert Fixnum into String the port number in MySQLKenta Okamoto2013-10-181-0/+9
|/
* Remove FirebirdDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-100/+0
| | | | 3rd-party.
* Remove SqlseverDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-87/+0
| | | | 3rd-party.
* Remove OracleDatabaseTasks was deprecated, because this was provided by ↵kennyj2013-06-051-93/+0
| | | | 3rd-party.
* Mute psql output when running rake db:schema:loadGodfrey Chan2013-04-301-1/+1
|
* Abort a rake task when missing db/structure.sql like `db:schema:load` task.kennyj2013-05-011-0/+7
|
* Show deprecated messages only when target database adapters definedYasuo Honda2013-04-033-3/+3
|
* Fix tiny problem: change method order for consistency and fix wrong method name.kennyj2013-04-031-1/+1
|
* Suppress deprecation messages for deprecated database tasks, when executing ↵kennyj2013-04-033-0/+21
| | | | rails's testcases.
* Extract Oracle database tasks.kennyj2013-04-031-0/+86
|
* Extract Sqlserver database tasks.kennyj2013-04-031-0/+80
|
* Extract Firebird database tasks.kennyj2013-04-031-0/+93
|
* `rake db:create` does not change permissions of root user.Yves Senn2013-03-171-2/+18
| | | | | | | | Closes #8079. I had to rework some of the tests because the mock allowed any arguments for `connection.exeucte`. I think this is very dangerous as there could anything be executed without the tests noticing it.
* rake db:structure:dump warns when `mysqldump` is not in PATH.Yves Senn2013-03-061-1/+12
| | | | | | | | Closes #9518. The rake task used to fail silently and left an empty `structure.sql`. It's confusing for users to get to the root of the problem. The warning message tells them where to look.
* Raise a specific exception with a useful message if a rake task is requested ↵Daniel Azuma2013-01-301-0/+6
| | | | for an unknown adapter
* Revert "Merge pull request #8942 from yahonda/tested_only_with_mysql"Carlos Antonio da Silva2013-01-151-4/+0
| | | | | | | | | | | This reverts commit 1fc294f988e93ac59057a16b0e44b9cf93af9720, reversing changes made to fb9ac47c286fbdfe05263d4d0346e50892090603. Reason: these tests should run fine independent of database, since they should only take into account the configuration options. The problem was related to a change in the way "nil" is handled by the rescue clause, in Ruby 2.0 it raises an exception asking for class or module, in 1.9 it passes.
* Address test_create_when_database_exists_outputs_info_to_stderr failuresYasuo Honda2013-01-151-0/+4
| | | | | When tested with ruby-2.0.0-rc1 `rake test` executes this test even if the target adapter is not mysql nor mysql2.
* Bring back "database already exists" messages when running rake tasksCarlos Antonio da Silva2013-01-123-7/+27
| | | | | | | | | | When running tasks such "rake db:setup", instead of showing messages like "db_development already exists", it was showing a big stack trace and a message "Couldn't create database for ..." with the configuration options, a very confusing message with a big trace. This brings back the functionality present in 3-2, showing the same message.
* Style: remove hash noiseJeremy Kemper2012-09-211-10/+10
|
* Correct default charset/collation for mysql dbsJeremy Kemper2012-09-211-9/+21
|
* Use configuration['encoding'], because database configuration use not ↵kennyj2012-09-121-2/+2
| | | | charset but encoding.