aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing/isolation.rb
Commit message (Collapse)AuthorAgeFilesLines
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-2/+2
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Fix arguments passing in testing isolationKir Shatrov2016-11-301-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue affects MRI 2.2.5, MRI 2.3.3, JRuby 9.1.6.0. It can be reproduced by: ``` $ cd activemodel $ NO_FORK=1 bundle exec rake test ``` If we wrap original arguments in quotes, it will be considered as a one big single argument. Later, [`rake/rake_test_loader.rb`](https://github.com/ruby/rake/blob/7863b97/lib/rake/rake_test_loader.rb#L15) will iterate over ARGS and try to require that huge single "argument" (which is a list of multiple .rb files). This leads to an exception: ``` /Users/kir/Project s/opensource/rails/vendor/bundle/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:15:in `require': cannot load such file -- /Users/kir/Projects/opensource/rails/activemodel/test/cases/ attribute_assignment_test.rb [stripped] /Users/kir/Projects/opensource/rails/activemodel/test/cases/validations/with_validation_test.rb /Users/kir/Projects/opensource/rails/activemodel/test/cases/validations_test .rb (LoadError) from /Users/kir/Projects/opensource/rails/vendor/bundle/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:15:in `block in <main>' from /Users/kir/Projects/opensource/rails/vendor/bundle/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:4:in `select' from /Users/kir/Projects/opensource/rails/vendor/bundle/gems/rake-11.3.0/lib/rake/rake_test_loader.rb:4:in `<main>' ``` Originally quotes were introduced in https://github.com/rails/rails/pull/19819 to fix MRI 2.2.2. The fix solves issue on all affected platforms: MRI 2.2.5, MRI 2.3.3, JRuby 9.1.6.0.
* Fix testing isolationKir Shatrov2016-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | AS::Testing::Isolation has two ways to isolate the process: forking and subprocessing. The second way is used on JRuby and other platforms that don't support forking. The way how subprocessing works is that we prepare a command to run a new process: ``` /opt/rubies/2.3.0/bin/ruby -I{skipped_load_path} test/initializable_test.rb '' -nInitializableTests::Basic#test_Initializer_provides_context's_class_name ``` As you see, there's unescaped quote at the end of the line. It leads to: ``` sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 1: syntax error: unexpected end of file ``` This fixes tests on MRI + NO_FORK variable and on JRuby :tada:
* 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.
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove `_run_class_setup`Jon Moss2016-06-101-11/+0
| | | | Should have been removed by 3073c531983de243219fb55be93fbcebfdd9c44e.
* make sure exceptions are marshalable when returning test resultsAaron Patterson2015-09-301-1/+17
| | | | | this should fix the error where isolation tests raise an exception and we just get a marshal error
* MRI compatible code for ActiveSupport::Testing::Isolation::SubprocessAlexey Gaziev2015-04-191-4/+4
|
* Better fork detection in ActiveSupport::Testing::Isolationdeepj2015-01-101-3/+1
| | | | | Process.respond_to?(:fork) returns false if fork is not available. More on http://www.ruby-doc.org/core-2.0.0/Process.html#method-c-fork
* Make the isolated tests run on JRubyRobin Dupret2014-06-211-6/+16
| | | | | | | | | | | | | | As there is no forking on JRuby, we need to spawn sub-processes to make the tests run in isolation. Previously, we were defining globally env variables and running the test file through backticks and delete these variables once the test ran. Now, we simply rely on IO.popen as this is cross-platform and the env variables are available during the child-process execution only so there are no race conditions. [Ben Browning & Robin Dupret]
* set encoding to binmode for pipeAnna Carey2014-01-171-0/+2
|
* Using parallelize_me! to parallelize isolated testArun Agrawal2013-12-101-6/+3
| | | | | As ParallelEach is no more available related commit ec00442c10cb90796909e876fb1cc557ed7518bd
* Minitest upgrade broke buildArun Agrawal2013-12-061-1/+1
| | | | | | https://github.com/seattlerb/minitest/commit/34760e3b268bc1bb4ac5fe1a44ef1ff0a2f9bd4d This PR should fix build
* Fix ActiveSupport::Testing::Isolation on jrubyAlex Tambellini2013-08-021-48/+4
| | | | | | | | | | | | | | | | | | Hopefully the first of many related to #11700. With these changes the railties tests wont 100% pass but at least they will run and show the errors. The first problem was the @method_name variable was never set. This was causing ENV["ISOLATION_TEST"] to always be nil which would cause the test output to never be written to the tempfile. The second problem was that an invalid -t option was being passed to minitest and minitest was erroring out. The third problem was the run method needs to always return an instance of the test class it is trying to isolate. We were returning a ProxyTestResult instead.
* Updates to make rails 4 happy with minitest 5:Ryan Davis2013-05-061-11/+6
| | | | | | | | | | + Namespace changes, overhaul of runners. + Internal ivar name changes - Removed a logger globally applied to tests that spew everywhere?!? + Override Minitest#__run to sort tests by name. + Reworked testing isolation to work with the new cleaner architecture. - Removed a bunch of tests that just test minitest straight up. I think these changes were all merged to minitest 4 a long time ago. - Minor report output differences.
* Work around change in how MiniTest detects SIGINFOJon Leighton2013-05-031-0/+4
| | | | | | | | | | | | | | | | | MiniTest 4.7.3 detects the presence of SIGINFO and stores the answer in a constant. It seems that MiniTest 4.7.4 changes this, and instead relies on an info_signal method being implemented on the runner object. In ActiveSupport::Testing::Isolation, we use ProxyTestResult to stand in for the runner object. This object implements `method_missing`, and as such its #info_signal method has a truthy return value. This results in MiniTest trying to install the SIGINFO handler on platforms where SIGINFO does not exists. To fix, I am simply defining an explicit ProxyTestResult#info_signal method.
* Bump up minitest dependency and remove our own reinvented version of ↵Akira Matsuda2013-02-191-37/+1
| | | | ParallelEach
* 'minitest/parallel_each' might not always be availableAkira Matsuda + Koichi Sasada2013-01-291-1/+4
|
* Needs to explicitly require 'minitest/parallel_each'Akira Matsuda + Koichi Sasada2013-01-291-0/+2
| | | | Minitest has changed to require this since https://github.com/seattlerb/minitest/commit/728054b
* The test setup is not threadsafe. Wrap in a mutex.Jon Leighton2013-01-181-3/+7
|
* MiniTest already defines a ParallelEach classJon Leighton2013-01-181-23/+27
| | | | | This may or may not fix the intermittent railties failures we've been seeing on the CI with Ruby 2.0. We'll see.
* added marshal_load and marshal_dump for ProxyTestResult. Behavior of ↵SHIBATA Hiroshi2013-01-051-2/+10
| | | | method_missing with Marshal.dump and Marshal.load is changing in ruby 2.0.0 later.
* add :nodoc: to internal implementations [ci skip]Francesco Rodriguez2012-06-221-1/+1
|
* Run the logger tests in isolationRafael Mendonça França2012-06-191-1/+1
|
* CORES needs to be a integerRafael Mendonça França2012-06-191-1/+1
|
* run railties tests in parallel, default to 2 coresAaron Patterson2012-06-191-0/+39
|
* no need in separate MiniTest modulesSergey Nartimov2012-01-241-14/+8
|
* Test::Unit::Collector::ObjectSpace is not present anymoreRafael Mendonça França2012-01-181-10/+0
|
* support only MiniTest run with Isolation test Vishnu Atrai2012-01-051-29/+1
|
* Config is deprecated on 1.8.8 and 1.9.3 use RbConfigSantiago Pastorino2010-08-231-1/+1
|
* AS::Isolation functional on Windows/JRuby.Nick Sieger2010-06-241-8/+11
| | | | | | Doesn't make up for the fact that it's slooooooooow, though. Signed-off-by: wycats <wycats@gmail.com>
* Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [#4477 state:resolved]Anil Wadghule2010-04-261-1/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Remove some 1.9 warnings (resulting in some fixed bugs). Remaining AM ↵wycats2010-03-171-2/+2
| | | | warnings are in dependencies.
* Allow ActiveSupport's isolation tests to run with MiniTest on 1.9Carl Lerche2009-12-301-18/+46
|
* Fixes remote errors in isolation testsYehuda Katz2009-11-231-0/+15
|
* Have all the tests running off a single GemfileYehuda Katz + Carl Lerche2009-10-201-2/+0
|
* Deprecate RAILS_ROOT in favor of Rails.root (which proxies to the ↵Carl Lerche2009-10-161-0/+2
| | | | application's object root)
* Finish porting over the initializers to the app object and fix all the testsCarl Lerche2009-10-141-2/+0
|
* To unmarshal MissingSourceFile from childJeremy Kemper2009-10-091-1/+3
|
* Fix the broken railties isolation testsCarl Lerche2009-09-291-4/+9
|
* Get Initializer tests running without requiring parts of Rails being loaded ↵Yehuda Katz + Carl Lerche2009-07-061-70/+72
| | | | first
* Adds support for def self.setup in isolation tests for setup that should be ↵Yehuda Katz + Carl Lerche2009-07-021-0/+5
| | | | run only once in the parent
* Crazy hacks to get the Isolation testing module to work on non forking ↵Yehuda Katz + Carl Lerche2009-06-301-10/+69
| | | | environments
* Created AS::Testing::Isolation which runs each test case in a separate process.Yehuda Katz + Carl Lerche2009-06-301-0/+39
This allows for testing rails bootup (files are required, correct constants are set, etc...). Currently, this is implemented via forking only, but we will add support for jruby and windows shortly.