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 CHANGED
@@ -1,3 +1,7 @@
1
+ 0.3.8
2
+
3
+ Testbot now uses exit code to determine if the test run has failed.
4
+
1
5
  0.3.7
2
6
 
3
7
  The runner now checks right away for another job if it got one last time around.
@@ -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
@@ -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
 
@@ -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
@@ -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
 
@@ -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
 
@@ -8,7 +8,7 @@ unless defined?(Testbot)
8
8
  require 'railtie' if defined?(Rails)
9
9
 
10
10
  # Don't forget to update readme and changelog
11
- VERSION = "0.3.7"
11
+ VERSION = "0.3.8.pre"
12
12
 
13
13
  SERVER_PID = "/tmp/testbot_server.pid"
14
14
  RUNNER_PID = "/tmp/testbot_runner.pid"
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: 29
5
- prerelease: false
4
+ hash: 961916028
5
+ prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 7
10
- version: 0.3.7
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: 3
224
+ hash: 25
224
225
  segments:
225
- - 0
226
- version: "0"
226
+ - 1
227
+ - 3
228
+ - 1
229
+ version: 1.3.1
227
230
  requirements: []
228
231
 
229
232
  rubyforge_project: