Skip to content

Commit

Permalink
Run lib tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
islemaster committed Oct 6, 2016
1 parent df9341b commit 84dcb8c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions deployment.rb
Expand Up @@ -364,3 +364,7 @@ def pegasus_dir(*paths)
def shared_dir(*dirs)
deploy_dir('shared', *dirs)
end

def lib_dir(*dirs)
deploy_dir('lib', *dirs)
end
12 changes: 12 additions & 0 deletions lib/Rakefile
@@ -0,0 +1,12 @@
require 'rake/testtask'

desc 'Run tests for lib directory'
task :test do
puts 'starting test task'
Rake::TestTask.new do |t|
t.warning = false
t.test_files = FileList["test/**/test_*.rb"]
end
end

task :default => :test
6 changes: 6 additions & 0 deletions lib/cdo/test_run_utils.rb
Expand Up @@ -66,4 +66,10 @@ def self.run_shared_tests
end
end
end

def self.run_lib_tests
Dir.chdir(lib_dir) do
RakeUtils.rake_stream_output 'test'
end
end
end
16 changes: 14 additions & 2 deletions lib/rake/test.rake
Expand Up @@ -31,6 +31,11 @@ namespace :test do
TestRunUtils.run_shared_tests
end

desc 'Runs lib tests.'
task :lib do
TestRunUtils.run_lib_tests
end

namespace :changed do
desc 'Runs apps tests if apps might have changed from staging.'
task :apps do
Expand Down Expand Up @@ -60,12 +65,19 @@ namespace :test do
end
end

task all: [:apps, :dashboard, :pegasus, :shared]
desc 'Runs lib tests if lib might have changed from staging.'
task :lib do
run_tests_if_changed('lib', ['lib/**/*']) do
TestRunUtils.run_lib_tests
end
end

task all: [:apps, :dashboard, :pegasus, :shared, :lib]
end

task changed: ['changed:all']

task all: [:apps, :dashboard, :pegasus, :shared]
task all: [:apps, :dashboard, :pegasus, :shared, :lib]
end
task test: ['test:changed']

Expand Down

0 comments on commit 84dcb8c

Please sign in to comment.