We select the error_id which has the compile file for more credible git bisect.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- src/extract-stats/stats_worker.cr | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/extract-stats/stats_worker.cr b/src/extract-stats/stats_worker.cr index bcf6e52..01bae21 100644 --- a/src/extract-stats/stats_worker.cr +++ b/src/extract-stats/stats_worker.cr @@ -82,10 +82,10 @@ class StatsWorker } )
- new_error_ids = check_new_error_ids(error_ids, job_id) - unless new_error_ids.empty? + error_id = select_error_id(check_new_error_ids(error_ids, job_id)) + if error_id STDOUT.puts "send a delimiter task: job_id is #{job_id}" - @tq.add_task(DELIMITER_TASK_QUEUE, JSON.parse({"error_id" => new_error_ids.sample, + @tq.add_task(DELIMITER_TASK_QUEUE, JSON.parse({"error_id" => error_id, "job_id" => job_id, "lab" => LAB}.to_json)) end @@ -93,6 +93,14 @@ class StatsWorker system "echo '#{msg}'" end
+ def select_error_id(new_error_ids : Array) + new_error_ids.each do |error_id| + return error_id if /(cpp|c|h):(warning|error)/i =~ error_id + end + + return nil + end + def check_new_error_ids(error_ids : Array, job_id : String) new_error_ids = [] of String error_ids.each do |error_id|