forked from PurposeOpen/Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (46 loc) · 1.45 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
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/dsl_definition'
require 'rubygems'
include Rake::DSL
begin
require 'cucumber'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
desc "Run Cuke"
Cucumber::Rake::Task.new(:cuke) do |t|
t.profile = "default"
end
namespace :platform do
desc "Run the equivalent of the platform-ci-full build on jenkins. It includes all cucumber specs that depend on javascript"
Cucumber::Rake::Task.new(:ci_full) do |t|
t.profile = "default"
end
end
namespace :test do
namespace :pre do
desc "Run pre checkin tests"
task :checkin => [:spec, :cuke, "jasmine:ci", :jslint]
task :parallel => ["parallel:spec", "parallel:features", "jasmine:ci", :jslint]
end
end
task :travis do
if ENV['TRAVIS_ENV'] == 'specs'
["jasmine:ci",:jslint, :spec].each do | t |
Rake::Task[t].invoke
end
else
group = ENV['TRAVIS_ENV']
["cucumber -p #{group}"].each do |cmd|
puts "Starting to run #{cmd}..."
system("export DISPLAY=:99.0 && bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
end
end
rescue LoadError
end
PurposePlatform::Application.load_tasks
task :default => 'test:pre:checkin'