[PATCH compass-ci 2/2] lib/compare_error_messages.rb: return false when matching error filename failed

If error_id = 'build-pkg.c++:fatal-error:switch'~x16~xe6~xab~xaa'does-not-start-with'-'', cannot get the error filename and return an empty hash. The empty hash is not credible too. Signed-off-by: Lin Jiaxin <ljx.joe@qq.com> --- lib/compare_error_messages.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/compare_error_messages.rb b/lib/compare_error_messages.rb index 2e35019..5f74be7 100644 --- a/lib/compare_error_messages.rb +++ b/lib/compare_error_messages.rb @@ -17,7 +17,9 @@ def credible?(previous_job_id, later_job_id, error_id) previous_result_file = File.join('/srv', es.query_by_id(previous_job_id)['result_root'], 'build-pkg') later_result_file = File.join('/srv', es.query_by_id(later_job_id)['result_root'], 'build-pkg') - return false if filenames_check(previous_result_file, later_result_file, error_id).value?(false) + filenames_check = filenames_check(previous_result_file, later_result_file, error_id) + + return false if filenames_check.empty? || filenames_check.value?(false) return true end -- 2.23.0
participants (1)
-
Lin Jiaxin