Signed-off-by: Cao Xueliang caoxl78320@163.com --- lib/git_bisect.rb | 8 +++----- src/delimiter/find-commit/bisect_run_script.rb | 18 +++++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 6aedda5..c0c0a60 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -3,7 +3,6 @@ # frozen_string_literal: true
require 'json' -require_relative 'es_query' require_relative 'error_messages' require_relative 'sched_client' require_relative '../src/delimiter/utils' @@ -12,7 +11,6 @@ require_relative "#{ENV['LKP_SRC']}/lib/monitor" # find the first bad commit class GitBisect def initialize(task) - @es = ESQuery.new @task = task end
@@ -54,7 +52,7 @@ class GitBisect puts "upstream_commit: #{@upstream_commit}" raise 'upstream info is null' unless @upstream_repo || @upstream_commit
- @upstream_repo_git = "git://#{GIT_MIRROR_HOST}/#{@upstream_repo}" + @upstream_repo_git = "git://#{GIT_MIRROR_HOST}/upstream/#{@upstream_repo}" end
def set_upstream_url @@ -66,7 +64,7 @@ class GitBisect def set_work_dir @work_dir = Utils.clone_repo(@upstream_repo_git, @upstream_commit) puts "work_dir: #{@work_dir}" - raise "checkout repo: #{@upstream_repo} to commit: #{@upstream_commit} failed!" unless @work_dir + raise "checkout repo: #{@upstream_repo_git} to commit: #{@upstream_commit} failed!" unless @work_dir end
def set_pkgbuild_repo @@ -104,7 +102,7 @@ class GitBisect return nil unless temp[0].include?('is the first bad commit') || temp[-1].include?('bisect run success')
first_bad_commit = Utils.parse_first_bad_commit(result) - bisect_error = ErrorMessages.new(@build_pkg_dir).obtain_error_messages_by_error_id(@error_id) + bisect_error = Utils.get_bisect_error(@bad_job_id, @error_id) all_errors = Utils.obt_errors(@work_dir, first_bad_commit) first_bad_commit_result_root = Utils.obt_result_root_by_commit(first_bad_commit)
diff --git a/src/delimiter/find-commit/bisect_run_script.rb b/src/delimiter/find-commit/bisect_run_script.rb index 8cdf675..05c529e 100755 --- a/src/delimiter/find-commit/bisect_run_script.rb +++ b/src/delimiter/find-commit/bisect_run_script.rb @@ -5,13 +5,11 @@ # frozen_string_literal: true
require 'json' -require_relative "#{ENV['CCI_SRC']}/lib/es_query" require_relative "#{ENV['CCI_SRC']}/src/delimiter/utils"
# git bisect run class GitBisectRun def initialize(job_id, error_id, work_dir) - @es = ESQuery.new @job_id = job_id @error_id = error_id @work_dir = work_dir @@ -27,12 +25,17 @@ class GitBisectRun private
def get_bisect_status(job) - status = Utils.get_job_status(job, @error_id) - exit 125 unless status + begin + status = Utils.get_job_status(job, @error_id) + exit 125 unless status
- exit 1 if status.eql?('bad') + exit 1 if status.eql?('bad')
- exit 0 + exit 0 + rescue StandardError => e + puts e.backtrace.inspect + exit -1 + end end end
@@ -43,6 +46,7 @@ begin
run = GitBisectRun.new job_id, error_id, work_dir run.git_bisect -rescue +rescue StandardError => e + puts e.backtrace.inspect exit -1 end