testbot 0.3.7 → 0.3.8.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/requester.rb +1 -10
- data/lib/runner.rb +1 -1
- data/lib/server.rb +2 -2
- data/lib/server/db.rb +2 -0
- data/lib/server/job.rb +3 -0
- data/lib/testbot.rb +1 -1
- metadata +11 -8
data/CHANGELOG
CHANGED
data/lib/requester.rb
CHANGED
@@ -84,13 +84,12 @@ class Requester
|
|
84
84
|
|
85
85
|
last_results_size = @build['results'].size
|
86
86
|
|
87
|
-
success = false if failed_build?(@build)
|
88
87
|
break if @build['done']
|
89
88
|
end
|
90
89
|
|
91
90
|
puts if config.simple_output
|
92
91
|
|
93
|
-
success
|
92
|
+
@build["success"]
|
94
93
|
end
|
95
94
|
|
96
95
|
def self.create_by_config(path)
|
@@ -120,18 +119,10 @@ class Requester
|
|
120
119
|
[ '0.0.0.0', 'localhost', '127.0.0.1' ].include?(config.server_host)
|
121
120
|
end
|
122
121
|
|
123
|
-
def failed_build?(build)
|
124
|
-
result_lines.any? { |line| line_is_failure?(line) }
|
125
|
-
end
|
126
|
-
|
127
122
|
def line_is_result?(line)
|
128
123
|
line =~ /\d+ fail/
|
129
124
|
end
|
130
125
|
|
131
|
-
def line_is_failure?(line)
|
132
|
-
line =~ /(\d{2,}|[1-9]) (fail|error)/
|
133
|
-
end
|
134
|
-
|
135
126
|
def jruby?
|
136
127
|
RUBY_PLATFORM =~ /java/ || !!ENV['USE_JRUBY']
|
137
128
|
end
|
data/lib/runner.rb
CHANGED
@@ -51,7 +51,7 @@ class Job
|
|
51
51
|
adapter = Adapter.find(@type)
|
52
52
|
result += `#{base_environment} #{adapter.command(ruby_cmd, @files)} 2>&1`
|
53
53
|
|
54
|
-
Server.put("/jobs/#{@id}", :body => { :result => result })
|
54
|
+
Server.put("/jobs/#{@id}", :body => { :result => result, :success => ($?.exitstatus == 0) })
|
55
55
|
puts "Job #{@id} finished."
|
56
56
|
end
|
57
57
|
|
data/lib/server.rb
CHANGED
@@ -29,7 +29,7 @@ end
|
|
29
29
|
get '/builds/:id' do
|
30
30
|
build = Build.find(:id => params[:id].to_i)
|
31
31
|
build.destroy if build[:done]
|
32
|
-
{ "done" => build[:done], "results" => build[:results] }.to_json
|
32
|
+
{ "done" => build[:done], "results" => build[:results], "success" => build[:success] }.to_json
|
33
33
|
end
|
34
34
|
|
35
35
|
get '/jobs/next' do
|
@@ -41,7 +41,7 @@ get '/jobs/next' do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
put '/jobs/:id' do
|
44
|
-
Job.find(:id => params[:id].to_i).update(:result => params[:result]); nil
|
44
|
+
Job.find(:id => params[:id].to_i).update(:result => params[:result], :success => params[:success]); nil
|
45
45
|
end
|
46
46
|
|
47
47
|
get '/runners/ping' do
|
data/lib/server/db.rb
CHANGED
@@ -12,6 +12,7 @@ DB.create_table :builds do
|
|
12
12
|
String :type
|
13
13
|
String :requester_mac
|
14
14
|
Integer :jruby
|
15
|
+
Boolean :success, :default => true
|
15
16
|
Boolean :done, :default => false
|
16
17
|
end
|
17
18
|
|
@@ -27,6 +28,7 @@ DB.create_table :jobs do
|
|
27
28
|
Integer :jruby
|
28
29
|
Integer :build_id
|
29
30
|
Integer :taken_by_id
|
31
|
+
Boolean :success
|
30
32
|
Datetime :taken_at, :default => nil
|
31
33
|
end
|
32
34
|
|
data/lib/server/job.rb
CHANGED
@@ -7,6 +7,9 @@ class Job < Sequel::Model
|
|
7
7
|
done = Job.filter([ "result IS NULL AND build_id = ?", self[:build_id] ]).count == 0
|
8
8
|
build.update(:results => build[:results].to_s + hash[:result].to_s,
|
9
9
|
:done => done)
|
10
|
+
|
11
|
+
build_broken_by_job = (hash[:success] == "false" && build[:success])
|
12
|
+
build.update(:success => false) if build_broken_by_job
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
data/lib/testbot.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 961916028
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
|
9
|
+
- 8
|
10
|
+
- pre
|
11
|
+
version: 0.3.8.pre
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- "Joakim Kolsj\xC3\xB6"
|
@@ -218,12 +219,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
220
|
none: false
|
220
221
|
requirements:
|
221
|
-
- - "
|
222
|
+
- - ">"
|
222
223
|
- !ruby/object:Gem::Version
|
223
|
-
hash:
|
224
|
+
hash: 25
|
224
225
|
segments:
|
225
|
-
-
|
226
|
-
|
226
|
+
- 1
|
227
|
+
- 3
|
228
|
+
- 1
|
229
|
+
version: 1.3.1
|
227
230
|
requirements: []
|
228
231
|
|
229
232
|
rubyforge_project:
|