aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/test_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add test parallelization to Railseileencodes2018-02-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provides both a forked process and threaded parallelization options. To use add `parallelize` to your test suite. Takes a `workers` argument that controls how many times the process is forked. For each process a new database will be created suffixed with the worker number; test-database-0 and test-database-1 respectively. If `ENV["PARALLEL_WORKERS"]` is set the workers argument will be ignored and the environment variable will be used instead. This is useful for CI environments, or other environments where you may need more workers than you do for local testing. If the number of workers is set to `1` or fewer, the tests will not be parallelized. The default parallelization method is to fork processes. If you'd like to use threads instead you can pass `with: :threads` to the `parallelize` method. Note the threaded parallelization does not create multiple database and will not work with system tests at this time. parallelize(workers: 2, with: :threads) The threaded parallelization uses Minitest's parallel exector directly. The processes paralleliztion uses a Ruby Drb server. For parallelization via threads a setup hook and cleanup hook are provided. ``` class ActiveSupport::TestCase parallelize_setup do |worker| # setup databases end parallelize_teardown do |worker| # cleanup database end parallelize(workers: 2) end ``` [Eileen M. Uchitelle, Aaron Patterson]
* Remove unnecessary migration deletionyuuji.yaginuma2017-11-081-5/+0
| | | | | Since isolation application is generated with the `--skip-gemfile` option, so `active_storage:install` is not executed.
* `rails new` runs `rails active_storage:install`bogdanvlviv2017-11-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c67e35b960e33677b5358c539f1047e4e1 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
* Run in-app rails commands via fork+load where possibleMatthew Draper2017-09-041-8/+8
| | | | | While this avoids shell argument parsing, we still pass through everything in our stack.
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* Set proper assertion to be sure the test failedbogdanvlviv2017-05-021-1/+1
|
* New minitest 'assert false' messagePavel Valena2017-04-261-1/+1
|
* Merge pull request #26515 from grosser/grosser/after_runArthur Nogueira Neves2016-09-231-1/+33
|\ | | | | support minitest after_run
| * support minitest after_run for parity to regular minitestMichael Grosser2016-09-161-0/+18
| | | | | | | | see https://github.com/seattlerb/minitest/blob/f9605387e4af7d657921a83aaf0ae364f6d26a57/lib/minitest.rb#L51-L65
| * improve test coverageMichael Grosser2016-09-161-2/+16
| |
* | improve error message when include assertions failMichael Grosser2016-09-161-2/+2
|/ | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* applies new string literal convention in railties/testXavier Noria2016-08-061-39/+39
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-041-1/+0
| | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* Be consistent in testing outputs from railties test and use /bin/rails ↵Vipul A M2016-01-241-1/+1
| | | | | | everywhere(the default behaviour now) instead of mix of /bin/rake /bin/rails everywhere [Ryo Hashimoto & Vipul A M]
* Improve test runner's Minitest integration.Kasper Timm Hansen2015-06-041-2/+2
| | | | | | | | | | | This also adds free mix and matching of directories, files and lines filters. Like so: bin/rails test models/post_test.rb test/integration models/person_test.rb:26 You can also mix in a traditional Minitest filter: bin/rails test test/integration -n /check_it_out/
* Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-301-1/+1
|
* run `test_test.rb` using the `bin/rails test`.Yves Senn2015-03-181-17/+1
|
* Show the right file when test raisesArthur Neves2015-03-181-0/+1
|
* bring back `db:test:prepare`.Yves Senn2014-11-251-0/+92
| | | | | | | | | | | | | | | 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.
* tests, run `test_test.rb` with `RAILS_ENV=test`.Yves Senn2014-11-251-1/+1
| | | | | | The tests to verify our testing setup used `RAILS_ENV=development` to execute the tests. Let's keep it as close to a real-world setup as possible.
* Revert "Revert "Merge pull request #15394 from ↵Yves Senn2014-08-061-1/+90
| | | | | | morgoth/fix-automatic-maintaining-test-schema-for-sql-format"" This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
* Revert "Merge pull request #15394 from ↵Rafael Mendonça França2014-07-021-90/+1
| | | | | | | | | | morgoth/fix-automatic-maintaining-test-schema-for-sql-format" This reverts commit 46139d33c06715e74ad450428ece3ee84da98579, reversing changes made to 8f247871bb18b2e3036a05df5f62cbfe3b402586. Conflicts: activerecord/CHANGELOG.md
* Fixed automatic maintaining test schema to properly handle sql structure ↵Wojciech Wnętrzak2014-06-121-2/+52
| | | | | | | | | schema format. Additionally: * It changes `purge` task on `sqlite3` adapter to recreate database file, to be consistent with other adapters. * Adds `purge` step when loading from `schema.rb`
* Added missing test case for migrations when using sql structureWojciech Wnętrzak2014-06-011-1/+40
|
* Automatically maintain test database schemaJon Leighton2014-01-021-1/+46
| | | | | | | | | | | | | | * 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".
* BACKTRACE environment variable to show unfiltered backtraces.Yves Senn2013-11-041-5/+34
| | | | | | | | | | | We used to support the `BACKTRACE` environment variable but when we switched to MiniTest it got removed: f9382cd7948 This commit adds back the functionality to show the unfiltered backtrace when needed. This also works when you run your tests with `rake`: * `BACKTRACE=1 bin/rake test` * `BACKTRACE=1 ruby -Itest ...`
* remove performance tests from the default stackYves Senn2013-01-101-25/+0
|
* convert railties to use AS::TestCaseAaron Patterson2012-01-051-1/+1
|
* Test::Unit::Util::BacktraceFilter not available in ruby19 test/unitVishnu Atrai2011-12-261-17/+0
|
* `run_test` method conflicts with newer minitest, so change the nameAaron Patterson2011-11-301-5/+5
|
* Solve the RAILS_ENV problem in the railties tests in a more generic wayJon Leighton2011-06-061-0/+4
|
* add tests for performance testJan Xie2011-05-051-0/+25
|
* Remove deprecated stuff in ActionControllerCarlos Antonio da Silva2010-09-261-1/+1
| | | | | | This removes all deprecated classes in ActionController related to Routing, Abstract Request/Response and Integration/IntegrationTest. All tests and docs were changed to ActionDispatch instead of ActionController.
* Check if Test::Unit is defined before adding backtrace filter.José Valim2010-02-071-0/+17
|
* assert_template depends on AV::Template monkey patches in action_view/test_caseJoshua Peek2010-01-051-0/+25
|
* Smoke test for test_helpJoshua Peek2010-01-041-0/+38