aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake
Commit message (Collapse)AuthorAgeFilesLines
* Fix `warning: ambiguous first argument`yuuji.yaginuma2017-07-251-1/+1
| | | | | | | | This fixes the following warning: ``` railties/test/application/rake/dbs_test.rb:265: warning: ambiguous first argument; put parentheses or a space even after `/' operator ```
* Avoid modifying frozen string in check_schema_fileEugene Kenny2017-07-231-0/+7
| | | | | | This was missed when the frozen string literal pragma was added to this file because the string is only modified when running in the context of a full Rails app, which wasn't covered by the test suite.
* Move test related to `tmp:clear` task to `tmp_test.rb`yuuji.yaginuma2017-07-021-0/+7
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-028-8/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-028-0/+8
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-017-0/+7
| |
* | Clear screenshots files in `tmp:clear` taskyuuji.yaginuma2017-06-271-0/+36
|/ | | | | | | | | If system test fails, it creates screenshot under `tmp/screenshots`. https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L45 But currently, screenshot files is not cleared by `tmp:clear` task. This patch make clears screenshot files with `tmp:clear` task as well as other tmp files.
* Also raise error when VERSION is nilRafael Mendonça França2017-04-271-0/+6
| | | | Fix #28905
* Add additional raise UnknownMigrationVersionErrorbogdanvlviv2017-04-191-1/+31
| | | | | Raise error on the movement of migrations when the current migration does not exist.
* Fix `bin/rails db:forward` first migrationbogdanvlviv2017-04-191-0/+25
|
* Remove duplicated "test" prefixRyuta Kamizono2017-04-071-3/+3
|
* Fixes #28359Philippe Guay2017-03-261-0/+16
| | | | | | | | | | | | | | | | Add stronger assertions to rake migration tasks to make sure the user is providing a numeric VERSION An empty string was getting converted to version = 0. This would in turn pass the presence check. Address linting warning Add test for rake task and refactor code to meet expectations In particular passing VERSION=0 should not raise an error. Addressed Comments for PR #28485. Trimmed empty lines + change of wording for error message Adjust test for change of wording in error message Change condition to follow rails idioms
* Remove unused requireRyuta Kamizono2017-02-122-2/+0
| | | | | | These files are not using `strip_heredoc`. Closes #27976
* update CREATE TABLE statements generated by `sqlite3` commandyuuji.yaginuma2017-01-191-2/+2
| | | | | | | From SQLite 3.16.0, `IF NOT EXISTS` set to CREATE TABLE statements. Ref: https://www.sqlite.org/src/info/c7021960f5c070fb Fixes #27635.
* clear all environments log files by defaultyuuji.yaginuma2016-10-141-0/+33
| | | | | | | In #22703, `log:clear` task has been changed to clear only standard environment log files. However, it is often to add a non-standard environment(e.g. "staging"). Therefore, I think than it is better to clear all environments log files by default.
* use rails command in restart task testyuuji.yaginuma2016-09-191-7/+7
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+1
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-062-53/+53
|
* applies new string literal convention in railties/testXavier Noria2016-08-066-78/+78
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #25652 from prathamesh-sonpatki/rm-boot-railsGuillermo Iguaran2016-07-085-5/+0
|\ | | | | Remove unused boot_rails method and it's usage
| * Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-045-5/+0
| | | | | | | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* | Fix test to try `spec/` directory as opposed to `app/spec` which I hadJohn Meehan2016-07-051-2/+2
| | | | | | | | | | | | accidently set it to. Made the change and test still passes.
* | removed extra blank lineJohn Meehan2016-07-051-1/+0
| |
* | Allow rake notes to work with other directories.John Meehan2016-07-051-0/+13
|/ | | | | | | Additional directories can be added using SourceAnnotationExtractor::Annotation.register_directories("spec", "other_dir") Result: rake notes will now extract notes from these directories.
* - using rails dev:cache instead of rake dev:cacheMohit Natoo2016-04-221-1/+1
|
* Fixed assertions with regex used in dbs testsVipul A M2016-04-191-2/+2
|
* Added notice when a database is successfully created or dropped.bogdanvlviv2016-04-171-2/+2
|
* Fix rails restart issue with PumaPrathamesh Sonpatki2016-03-302-0/+18
| | | | | | | | | | | | | | | - We need to pass the restart command to Puma so that it will use it while restarting the server. - Also made sure that all the options passed by user while starting the server are used in the generated restart command so that they will be used while restarting the server. - Besides that we need to remove the server.pid file for the previous running server because otherwise Rack complains about it's presence. - We don't care if the server.pid file does not exist. We only want to delete it if it exists. - This also requires some changes on Puma side which are being tracked here - https://github.com/puma/puma/pull/936. - Fixes #23910.
* - using rails dev:cache instead of rake dev:cache in test caseMohit Natoo2016-03-041-1/+1
|
* revert dev:cache to rake task, fixes #23410Scott Bronson2016-02-071-0/+34
|
* Shorten ActiveRecord::InternalMetadata.table_name to ar_internal_metadataYasuo Honda2016-02-011-2/+2
| | | | to support Oracle database which only supports 30 byte identifier length
* Be consistent in testing outputs from railties test and use /bin/rails ↵Vipul A M2016-01-243-56/+56
| | | | | | everywhere(the default behaviour now) instead of mix of /bin/rake /bin/rails everywhere [Ryo Hashimoto & Vipul A M]
* Fixing tests and re-locating error checking.schneems2016-01-081-2/+2
|
* Prevent destructive action on production databaseschneems2016-01-071-3/+3
| | | | | | | This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd. It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large. To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
* Internal test migrations use the private 'Current' versionMatthew Draper2015-12-151-3/+3
| | | | | | | | Apart from specific versioning support, our tests should focus on the behaviour of whatever version they're accompanying, regardless of when they were written. Application code should *not* do this.
* Add Rails command infrastructure and encapsulate development cachingChuck Callebs2015-12-041-35/+0
|
* Remove warningsRafael Mendonça França2015-12-041-4/+4
|
* Make `db:migrate:status` to render `1_some.rb` format migrate files.yui-knk2015-11-021-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `1_valid_people_have_last_names.rb` and `20150823202140_create_users.rb` are valid migration file name. But `1_valid_people_have_last_names.rb` is rendered as `********** NO FILE **********` when `rake db:migrate:status`. Fix to this bug, this commit includes * define some API private methdos and a Constant `match_to_migration_filename?`, `parse_migration_filename`, and `MigrationFilenameRegexp` * use these methods in `db:migrate:status` task Example: These files are in `db/migrate` * 1_valid_people_have_last_names.rb * 20150819202140_irreversible_migration.rb * 20150823202140_add_admin_flag_to_users.rb * 20150823202141_migration_tests.rb * 2_we_need_reminders.rb * 3_innocent_jointable.rb we can migrate all of them. Before ```shell $ bundle exec rake db:migrate:status ... Status Migration ID Migration Name -------------------------------------------------- up 001 ********** NO FILE ********** up 002 ********** NO FILE ********** up 003 ********** NO FILE ********** up 20150819202140 Irreversible migration up 20150823202140 Add admin flag to users up 20150823202141 Migration tests ``` After ```shell $ bundle exec rake db:migrate:status ... Status Migration ID Migration Name -------------------------------------------------- up 001 Valid people have last names up 002 We need reminders up 003 Innocent jointable up 20150819202140 Irreversible migration up 20150823202140 Add admin flag to users up 20150823202141 Migration tests ```
* Exit with non-zero status when db:drop failsJay Hayes2015-10-201-0/+10
| | | | | | | | | | | * If the drop task fails for a reason other than the database not existing, processing should end. This is indicated by a non-zero exit status. * Since the backtrace is already printed to screen, we forgo printing it again by using an explicit call to `exit`. * :warning: This modifies the behavior of the db:create task slightly in that the stack trace is no longer printed by default. If the `--trace` option is used, it will print the trace _after_ the error message.
* Exit with non-zero status when db:create failsJay Hayes2015-10-201-0/+17
| | | | | | | | | | | * If the create task fails for a reason other than the database already existing, processing should end. This is indicated by a non-zero exit status. * Since the backtrace is already printed to screen, we forgo printing it again by using an explicit call to `exit`. * :warning: This modifies the behavior of the db:create task slightly in that the stack trace is no longer printed by default. If the `--trace` option is used, it will print the trace _after_ the error message.
* Fix test of drop failureJay Hayes2015-10-201-4/+1
| | | | | | | * Previously the sqlite3 adapter could not "fail" on drop. Now an error is raised when no file exists. * Also updates purge to be resilient of drop failures. This is how purge is expected to behave.
* Add tests to verify exit status for create/drop failuresJay Hayes2015-10-201-0/+28
| | | | | | | | | | * Running the db:create task when the database already exists isn't really an error case. That is processing may proceed in this case because the database exists as requested. So let's validate that behavior with a test. * Likewise, if the database doesn't exist when running the db:drop task processing may continue as the requested condition is already met. Thus a test.
* Add rake dev:cache task to enable dev mode caching.Chuck Callebs2015-08-041-0/+35
| | | | | | | | | | | | | | | | Taken from @Sonopa's commits on PR #19091. Add support for dev caching via "rails s" flags. Implement suggestions from @kaspth. Remove temporary cache file if server does not have flags. Break at 80 characters in railties/CHANGELOG.md Remove ability to disable cache based on server options. Add more comprehensive options: --dev-caching / --no-dev-caching
* Fix rake/notes_testschneems2015-07-291-0/+1
| | | | | | | | | | | Presumably due to https://github.com/rails/sprockets-rails/pull/265 sprockets was trying to load the "scss" gem but it isn't in the gemfile: ``` ApplicationTests::RakeTests::RakeNotesTest#test_register_a_new_extension: LoadError: cannot load such file -- sass ``` If we use an empty precompile list, it won't try to load sass.
* `dump_schema_after_migration` applies migration tasks other than db:migrateYves Senn2015-06-301-6/+8
| | | | | | | | | | | | | Closes #20743. The task `db:_dump` now only dumps the schema if `ActiveRecord::Base.dump_schema_after_migration` is true. This has effects: - `db:migrate:up` - `db:migrate:down` - `db:forward` - `db:rollback`
* tests, railties tests should use `bin/` executables when possible.Yves Senn2015-06-303-68/+68
| | | | | We recommend using the `bin/` executables in our docs and guides. Let's make sure that our tests execute the same code path.
* `rake restart` should work without a `tmp` folderYoong Kang Lim2015-05-301-2/+10
| | | | | | | | | | | | | In restart.rake, the creation of tmp/restart.txt would fail if the tmp folder does not exist in the app. This is a problem because apps cloned using git would not have the tmp folder, as the folder is in .gitignore. This commit creates the tmp folder if it does not exist. Fixes #20299 [Yoong Kang Lim, Sunny Juneja]
* Merge pull request #20326 from hderms/dh/fix_task_bugRafael Mendonça França2015-05-271-0/+48
|\ | | | | | | Fix rake method definition leaking onto Object
| * add fixed fileDermot Haughey2015-05-271-0/+46
|/ | | | | | add framework_test add another test