wwtd 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/lib/wwtd.rb +25 -9
- data/lib/wwtd/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/wwtd.rb
CHANGED
@@ -4,6 +4,7 @@ require "yaml"
|
|
4
4
|
require "shellwords"
|
5
5
|
require "parallel"
|
6
6
|
require "tempfile"
|
7
|
+
require "tmpdir"
|
7
8
|
|
8
9
|
module WWTD
|
9
10
|
CONFIG = ".travis.yml"
|
@@ -24,18 +25,20 @@ module WWTD
|
|
24
25
|
# Execute tests
|
25
26
|
matrix = matrix(config)
|
26
27
|
results = nil
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
with_clean_dot_bundle do
|
29
|
+
Tempfile.open "wwtd" do |lock|
|
30
|
+
results = Parallel.map(matrix.each_with_index, :in_processes => options[:parallel].to_i) do |config, i|
|
31
|
+
ENV["TEST_ENV_NUMBER"] = (i == 0 ? "" : (i + 1).to_s) if options[:parallel]
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
config_info = config_info(matrix, config)
|
34
|
+
puts "#{yellow("START")} #{config_info}"
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
result = run_config(config, lock)
|
37
|
+
info = "#{result ? green("SUCCESS") : red("FAILURE")} #{config_info}"
|
38
|
+
puts info
|
37
39
|
|
38
|
-
|
40
|
+
[result, info]
|
41
|
+
end
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
@@ -50,6 +53,19 @@ module WWTD
|
|
50
53
|
|
51
54
|
private
|
52
55
|
|
56
|
+
def with_clean_dot_bundle
|
57
|
+
had_old = File.exist?(".bundle")
|
58
|
+
Dir.mktmpdir do |dir|
|
59
|
+
begin
|
60
|
+
sh "mv .bundle #{dir}" if had_old
|
61
|
+
yield
|
62
|
+
ensure
|
63
|
+
sh "rm -rf .bundle"
|
64
|
+
sh "mv #{dir}/.bundle ." if had_old
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
53
69
|
def config_info(matrix, config)
|
54
70
|
config = config.select { |k,v| matrix.map { |c| c[k] }.uniq.size > 1 }.sort
|
55
71
|
"#{config.map { |k,v| "#{k}: #{truncate(v, 30)}" }.join(", ")}"
|
data/lib/wwtd/version.rb
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|