snakeeyes 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/snakeeyes.rb +22 -11
- metadata +4 -4
data/lib/snakeeyes.rb
CHANGED
@@ -18,6 +18,7 @@ class SnakeEyes
|
|
18
18
|
|
19
19
|
def start
|
20
20
|
Dir.chdir(@path) do
|
21
|
+
custom_sleep
|
21
22
|
debug "Starting loop"
|
22
23
|
main_loop
|
23
24
|
end
|
@@ -25,17 +26,19 @@ class SnakeEyes
|
|
25
26
|
|
26
27
|
def main_loop
|
27
28
|
while true
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
begin
|
30
|
+
debug "Start #{@path}"
|
31
|
+
if has_new_commits || first_run
|
32
|
+
reset_to_newest_commit
|
33
|
+
pass, output = run_tests
|
34
|
+
report_tests(pass, output)
|
35
|
+
@run_count += 1
|
36
|
+
else
|
37
|
+
heartbeat
|
38
|
+
end
|
39
|
+
rescue StandardError => e
|
40
|
+
puts "!!! There was some issue or another: #{e.message} !!!"
|
37
41
|
end
|
38
|
-
|
39
42
|
sleepy_time
|
40
43
|
end
|
41
44
|
end
|
@@ -44,10 +47,19 @@ class SnakeEyes
|
|
44
47
|
@run_count == 0
|
45
48
|
end
|
46
49
|
|
50
|
+
def custom_sleep
|
51
|
+
timer = git("config cijoe.sleep")
|
52
|
+
if timer.size > 0
|
53
|
+
debug "SETTING CUSTOM TIMER: #{timer}"
|
54
|
+
@sleep = timer.to_i
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
47
58
|
# if something is new, reset to it
|
48
59
|
def reset_to_newest_commit
|
49
60
|
debug "reset to newest commit (#{@omaster})"
|
50
61
|
git("reset --hard #{@omaster}")
|
62
|
+
@master = @omaster
|
51
63
|
end
|
52
64
|
|
53
65
|
def run_tests
|
@@ -150,7 +162,6 @@ class SnakeEyes
|
|
150
162
|
end
|
151
163
|
|
152
164
|
def hawk_config
|
153
|
-
return @config if @config
|
154
165
|
c = {}
|
155
166
|
config = git('config --list')
|
156
167
|
config.split("\n").each do |line|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snakeeyes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Scott Chacon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-20 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|