Merge pull request #2859 from jekyll/parallelize-tests

This commit is contained in:
Parker Moore 2014-08-30 19:34:25 -07:00
commit 7ff5505e97
4 changed files with 10 additions and 54 deletions

View File

@ -25,3 +25,6 @@ env:
global:
- secure: bt5nglPTdsc0N5fB1dOJz2WbM81dGpDuVD8PnhEsxgUfoo6xavhU4+pNrUADlSUqQ1aJrdU+MKW4x+JZ2ZnJS8vOpNzRymuMZSbFaljK4pgFGiKFgBdMKxVikvoYcxKCjLAl7NJZ11W6hUw+JtJScClDZwrJJAQB6I7Isp/LsdM=
- secure: Ym8nx7nbfGYGo47my92M+deJykaiMkdZdb615EO51liv/xy/0aQ919Jpfieugc9d3zVnm+zFGPbpv4YzRpsik6OlVBNa4lP+BnQ27ptf5YcLWD8Hksi7845WFLecXMoaTCoYer/TvYZsIWJb2nSDMH9qbfZhnd1YZKuvUpK0rEU=
matrix:
- TEST_SUITE=test
- TEST_SUITE=cucumber

View File

@ -1,11 +1,12 @@
require 'fileutils'
require 'posix-spawn'
require 'rr'
require 'test/unit'
require 'time'
JEKYLL_SOURCE_DIR = File.dirname(File.dirname(File.dirname(__FILE__)))
TEST_DIR = File.expand_path(File.join('..', '..', 'tmp', 'jekyll'), File.dirname(__FILE__))
JEKYLL_PATH = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll')
JEKYLL_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll'))
JEKYLL_COMMAND_OUTPUT_FILE = File.join(File.dirname(TEST_DIR), 'jekyll_output.txt')
def source_dir(*files)
@ -17,11 +18,12 @@ def jekyll_output_file
end
def jekyll_run_output
File.read(jekyll_output_file)
File.read(jekyll_output_file) if File.file?(jekyll_output_file)
end
def run_jekyll(args)
system "#{JEKYLL_PATH} #{args} --trace > #{jekyll_output_file} 2>&1"
child = POSIX::Spawn::Child.new JEKYLL_PATH, *args.strip.split(' '), "--trace", :out => [JEKYLL_COMMAND_OUTPUT_FILE, "w"]
child.status.exitstatus == 0
end
def slug(title)

View File

@ -34,6 +34,7 @@ module Features
end
def after_features(features)
@io.puts
print_summary(features)
end
@ -73,18 +74,6 @@ module Features
print_feature_element_name(keyword, name, file_colon_line, source_indent)
end
def before_examples_array(examples_array)
end
def examples_name(keyword, name)
end
def before_outline_table(outline_table)
end
def after_outline_table(outline_table)
end
def scenario_name(keyword, name, file_colon_line, source_indent)
print_feature_element_name(keyword, name, file_colon_line, source_indent)
end
@ -121,38 +110,12 @@ module Features
@io.print CHARS[status]
end
def doc_string(string)
return if @options[:no_multiline] || @hide_this_step
s = %{"""\n#{string}\n"""}.indent(@indent)
s = s.split("\n").map{|l| l =~ /^\s+$/ ? '' : l}.join("\n")
@io.puts(format_string(s, @current_step.status))
@io.flush
end
def exception(exception, status)
return if @hide_this_step
print_exception(exception, status, @indent)
@io.flush
end
def before_multiline_arg(multiline_arg)
end
def after_multiline_arg(multiline_arg)
end
def before_table_row(table_row)
end
def after_table_row(table_row)
end
def after_table_cell(cell)
end
def table_cell_value(value, status)
end
private
def print_feature_element_name(keyword, name, file_colon_line, source_indent)

View File

@ -1,16 +1,4 @@
#! /bin/bash
set -e
parallelize_tests() {
ls -1 script/{test,cucumber,proof} | xargs -P 3 -L 1 /bin/bash
}
serialize_tests() {
script/proof
script/test
script/cucumber
}
script/branding
time parallelize_tests
script/$TEST_SUITE