Closed belgoros closed 12 years ago
Yep, read [this issue]{https://github.com/guard/guard-spork/issues/34}.
ok, thanks a lot. So, as far as I understood, officially there is no way to use it on Windows, running tests there is a real headache :(
Yep, using a Mac/Linux machine is the way to go. Sorry.
ok, thanks a lot. So, as far as I understood, officially there is no way to use it on Windows, running tests there is a real headache :(
@belgoros See the Rails test guides, section 3.2 to change workers -- which use the said fork(method) to paralleled processes -- to threads. This last one use another method to parallel processes. Also take a look on the beginning of the section 3, which describes how the tests are made. I have used a WSL2 to run Rails. However the local test needs the jruby to be executed in somewhat.
To change the parallelization method to use threads over forks put the following in your test_helper.rb
class ActiveSupport::TestCase
parallelize(workers: :number_of_processors, with: :threads)
end
After, specify in your command rails test
how much workers you need, such as PARALLEL_WORKERS=1 rails test
or PARALLEL_WORKERS=15 rails test
.
A few months ago I got sad since I realize as you there is no way to test rails on Windows Machine. Yesterday, I could do my first test on Rails in my Windows. I use a WSL2. But it is not enough to run the tests. In somewhat, the local test uses the windows threads instead of fork() method.
And welcome again to Windows :)
I followed the railscasts on Spork at http://railscasts.com/episodes/285-spork and got the below error when running 'guard' command:
Here are my configuration details:
Rails 3.1.1 spork (0.9.0.rc9 x86-mingw32) guard (0.8.8) guard-rspec (0.5.1, 0.5.0) guard-spork (0.3.1) rspec (2.7.0) rspec-core (2.7.1, 2.7.0) rspec-expectations (2.7.0) rspec-mocks (2.7.0) rspec-rails (2.7.0)
Is it a normal behavior for Windows-like OS? Thanks.