This shaves off about 0.8 seconds from the test time with warm caches, and about two seconds with cold caches (disk cache not included).
Is this something we want to do? I could go ahead and isolate even more things, but if it's not wanted then I won't bother.
This pull request fails (merged 1b540796 into 3dc56d4).
This pull request fails (merged 8631a1b0 into 3dc56d4).
The specs fail due to some odd bug. If I run them locally with bundle exec rspec spec/**/*_spec.rb, they pass. If I run bundle exec rake, they fail. Only difference is the order the spec files are run in.
bundle exec rspec spec/**/*_spec.rb
bundle exec rake
@henrikhodne if there is an ordering issue then maybe you could try and fix that as well?
@joshk I'm working on it.
Isolate Travis::API specs
require_relative doesn't exist in JRuby-18mode
Ok, I found the problem. When api_spec.rb is run, it creates the Repository class. This means that rails won't autoload it. So, in short, this can't be done unless we separate specs into specs that can be run without rails and specs that have to be run with rails and then run them separately. At least that's all I can think of.
Stub the Repository class
The api_spec.rb file is ran first on some ruby implementations/systems,
and if we create the Repository class there, that messes up Rails'
autoloading in later tests.
This pull request passes (merged 73b6ee0 into 2531cab).
why are you commenting like travisbot comments?
Because the job got stuck, but the entire matrix passed (check the log messages).
I stand corrected… Sorry about that.
What about not using mocha (in relation to #93) ?
I wouldn't mind moving away from mocha. I think the tests need some rewriting though.