-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathRakefile
65 lines (53 loc) · 1.56 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
Bundler::GemHelper.install_tasks
begin
APP_RAKEFILE = File.expand_path('../spec/internal/Rakefile', __FILE__)
load 'rails/tasks/engine.rake'
rescue LoadError
puts "Unable to load all app tasks for #{APP_RAKEFILE}"
end
require 'engine_cart/rake_task'
require 'rspec/core/rake_task'
namespace :spec do
RSpec::Core::RakeTask.new(:all) do
ENV['COVERAGE'] = 'true'
end
desc 'Only run specs that do not require net connect'
RSpec::Core::RakeTask.new(:offline) do |t|
t.rspec_opts = '--tag ~requires_net_connect'
end
desc 'Only run specs that require net connect'
RSpec::Core::RakeTask.new(:online) do |t|
t.rspec_opts = '--tag requires_net_connect'
end
desc 'Run the Jenkins CI specs'
task :jenkins do
ENV['RAILS_ENV'] = 'test'
ENV['SPEC_OPTS'] = '--profile 20'
Rake::Task['engine_cart:clean'].invoke
Rake::Task['engine_cart:generate'].invoke
Rake::Task['spec:all'].invoke
end
desc 'Run the Travis CI specs'
task :travis do
ENV['RAILS_ENV'] = 'test'
ENV['SPEC_OPTS'] = '--profile 20'
ENV['ORCID_APP_ID'] = 'bleck'
ENV['ORCID_APP_SECRET'] = 'bleck'
Rake::Task['engine_cart:clean'].invoke
Rake::Task['engine_cart:generate'].invoke
Rake::Task['spec:offline'].invoke
end
end
begin
Rake::Task['default'].clear
rescue RuntimeError
# This isn't a big deal if we don't have a default
end
Rake::Task['spec'].clear
task spec: 'spec:offline'
task default: 'spec:travis'