We create a file and put it in "/tmp/lkp/result" dir, the lkp-tests will upload the file when finished the job.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- lib/git_bisect.rb | 1 + src/delimiter/constants.rb | 2 ++ src/delimiter/utils.rb | 10 ++-------- 3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 7543646..b54be4d 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -81,6 +81,7 @@ class GitBisect if temp[0].include? 'Bisecting' result = `git -C #{@work_dir} bisect run #{BISECT_RUN_SCRIPT} #{@bad_job_id} "#{@error_id}" #{@work_dir}` end + Utils.create_bisect_log(@work_dir) FileUtils.rm_r(@work_dir) if Dir.exist?(@work_dir) puts "\nbisect result: #{result}" analyse_result(result) diff --git a/src/delimiter/constants.rb b/src/delimiter/constants.rb index 5e5406f..7097c6f 100644 --- a/src/delimiter/constants.rb +++ b/src/delimiter/constants.rb @@ -11,3 +11,5 @@ TMEP_GIT_BASE = '/c/public_git' DELIMITER_TASK_QUEUE = 'delimiter' BISECT_RUN_SCRIPT = "#{ENV['CCI_SRC']}/src/delimiter/find-commit/bisect_run_script.rb" RESULT_WEBDAV_URL = ENV['RESULT_WEBDAV_URL'] || "http://172.17.0.1:3080" +# The files which are in this dir can be uploaded by lkp-tests +TMP_RESULT_ROOT = '/tmp/lkp/result' diff --git a/src/delimiter/utils.rb b/src/delimiter/utils.rb index 60b64a1..b60ada0 100644 --- a/src/delimiter/utils.rb +++ b/src/delimiter/utils.rb @@ -122,18 +122,12 @@ module Utils return bisect_log_arr end
- def create_bisect_log(job_id, git_dir) - log_file = File.join(git_dir, "#{job_id}_bisect.log") + def create_bisect_log(git_dir) + log_file = File.join(TMP_RESULT_ROOT, "bisect.log") log_content = parse_bisect_log(git_dir) File.open(log_file, 'w') do |f| log_content.each { |line| f.puts(line) } end - - return log_file - end - - def upload_bisect_log(log_file, dest_dir, access_key) - %x(curl -sSf -T "#{log_file}" #{RESULT_WEBDAV_URL}/#{dest_dir} --cookie "ACCESSKEY=#{access_key}") end end end
Ignored this patch.
Thanks, Xueliang
On Wed, Dec 09, 2020 at 06:20:09PM +0800, Cao Xueliang wrote:
We create a file and put it in "/tmp/lkp/result" dir, the lkp-tests will upload the file when finished the job.
Signed-off-by: Cao Xueliang caoxl78320@163.com
lib/git_bisect.rb | 1 + src/delimiter/constants.rb | 2 ++ src/delimiter/utils.rb | 10 ++-------- 3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lib/git_bisect.rb b/lib/git_bisect.rb index 7543646..b54be4d 100644 --- a/lib/git_bisect.rb +++ b/lib/git_bisect.rb @@ -81,6 +81,7 @@ class GitBisect if temp[0].include? 'Bisecting' result = `git -C #{@work_dir} bisect run #{BISECT_RUN_SCRIPT} #{@bad_job_id} "#{@error_id}" #{@work_dir}` end
- Utils.create_bisect_log(@work_dir) FileUtils.rm_r(@work_dir) if Dir.exist?(@work_dir) puts "\nbisect result: #{result}" analyse_result(result)
diff --git a/src/delimiter/constants.rb b/src/delimiter/constants.rb index 5e5406f..7097c6f 100644 --- a/src/delimiter/constants.rb +++ b/src/delimiter/constants.rb @@ -11,3 +11,5 @@ TMEP_GIT_BASE = '/c/public_git' DELIMITER_TASK_QUEUE = 'delimiter' BISECT_RUN_SCRIPT = "#{ENV['CCI_SRC']}/src/delimiter/find-commit/bisect_run_script.rb" RESULT_WEBDAV_URL = ENV['RESULT_WEBDAV_URL'] || "http://172.17.0.1:3080" +# The files which are in this dir can be uploaded by lkp-tests +TMP_RESULT_ROOT = '/tmp/lkp/result' diff --git a/src/delimiter/utils.rb b/src/delimiter/utils.rb index 60b64a1..b60ada0 100644 --- a/src/delimiter/utils.rb +++ b/src/delimiter/utils.rb @@ -122,18 +122,12 @@ module Utils return bisect_log_arr end
- def create_bisect_log(job_id, git_dir)
log_file = File.join(git_dir, "#{job_id}_bisect.log")
- def create_bisect_log(git_dir)
log_file = File.join(TMP_RESULT_ROOT, "bisect.log") log_content = parse_bisect_log(git_dir) File.open(log_file, 'w') do |f| log_content.each { |line| f.puts(line) } end
return log_file
- end
- def upload_bisect_log(log_file, dest_dir, access_key)
end end%x(curl -sSf -T "#{log_file}" #{RESULT_WEBDAV_URL}/#{dest_dir} --cookie "ACCESSKEY=#{access_key}")
end
2.23.0