From 30d1f90b4405af3cf63a6b8a635b7572a4d350cb Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 17:14:47 -0700 Subject: [PATCH 1/6] Allow Travis to 'parallelize' our tests. --- .travis.yml | 2 ++ script/cibuild | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 09b649ad..a51fd94a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,3 +25,5 @@ env: global: - secure: bt5nglPTdsc0N5fB1dOJz2WbM81dGpDuVD8PnhEsxgUfoo6xavhU4+pNrUADlSUqQ1aJrdU+MKW4x+JZ2ZnJS8vOpNzRymuMZSbFaljK4pgFGiKFgBdMKxVikvoYcxKCjLAl7NJZ11W6hUw+JtJScClDZwrJJAQB6I7Isp/LsdM= - secure: Ym8nx7nbfGYGo47my92M+deJykaiMkdZdb615EO51liv/xy/0aQ919Jpfieugc9d3zVnm+zFGPbpv4YzRpsik6OlVBNa4lP+BnQ27ptf5YcLWD8Hksi7845WFLecXMoaTCoYer/TvYZsIWJb2nSDMH9qbfZhnd1YZKuvUpK0rEU= + - TEST_SUITE=test + - TEST_SUITE=features diff --git a/script/cibuild b/script/cibuild index d2dd4ae4..a69060f6 100755 --- a/script/cibuild +++ b/script/cibuild @@ -13,4 +13,4 @@ serialize_tests() { } script/branding -time parallelize_tests +bundle exec rake $TEST_SUITE From 2d485ab6fe26c1023e1dedf37bdbdc0ffea0f371 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 17:16:03 -0700 Subject: [PATCH 2/6] It's a matrix env. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a51fd94a..60326de4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,5 +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=features From f90d8db82758aba7a643a3ae21136e97532ec1f6 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 18:27:42 -0700 Subject: [PATCH 3/6] Run the scripts properly. --- .travis.yml | 2 +- script/cibuild | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60326de4..d80b437c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,4 +27,4 @@ env: - secure: Ym8nx7nbfGYGo47my92M+deJykaiMkdZdb615EO51liv/xy/0aQ919Jpfieugc9d3zVnm+zFGPbpv4YzRpsik6OlVBNa4lP+BnQ27ptf5YcLWD8Hksi7845WFLecXMoaTCoYer/TvYZsIWJb2nSDMH9qbfZhnd1YZKuvUpK0rEU= matrix: - TEST_SUITE=test - - TEST_SUITE=features + - TEST_SUITE=cucumber diff --git a/script/cibuild b/script/cibuild index a69060f6..4d4b6dbe 100755 --- a/script/cibuild +++ b/script/cibuild @@ -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 -bundle exec rake $TEST_SUITE +script/$TEST_SUITE From efd2c17eba8016710f288fc64a9628a18dd03379 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 18:37:00 -0700 Subject: [PATCH 4/6] Don't print out docstrings. --- features/support/overview.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/features/support/overview.rb b/features/support/overview.rb index 493ef6a6..ffe7f92c 100644 --- a/features/support/overview.rb +++ b/features/support/overview.rb @@ -122,11 +122,6 @@ module Features 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) From f9bc50e010d2b4470f5efde8403b7eb633226487 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 19:28:37 -0700 Subject: [PATCH 5/6] Fix the custom Cucumber output. --- features/support/overview.rb | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/features/support/overview.rb b/features/support/overview.rb index ffe7f92c..79e9e603 100644 --- a/features/support/overview.rb +++ b/features/support/overview.rb @@ -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,33 +110,12 @@ module Features @io.print CHARS[status] end - def doc_string(string) - 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) From 106148280d76cf180ae2bc1158ed2c2d7bc664d4 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sat, 30 Aug 2014 19:29:01 -0700 Subject: [PATCH 6/6] Use POSIX::Spawn instead of system to launch Jekyll --- features/support/env.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/support/env.rb b/features/support/env.rb index 2f5f5e5f..996c79ba 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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)