[Why]
use:
compare group_id=fio-basic-openeuler-acr-1301864-1,fio-basic-openeuler-acr-1301864-2,fio-basic-openeuler-acr-1301864-3 -d pp.acr3.acr
error message:
Traceback (most recent call last):
2: from /home/wangyong/compass-ci/sbin/compare:72:in `<main>'
1: from /home/wangyong/compass-ci/lib/compare.rb:66:in `compare_group'
/home/lwt/compass-ci/lib/compare_matrixes.rb:400:in `compare_group_matrices': undefined method `[]' for nil:NilClass (NoMethodError)
Signed-off-by: Lu Weitao <luweitaobe(a)163.com>
---
lib/compare.rb | 4 ++++
lib/matrix2.rb | 2 ++
2 files changed, 6 insertions(+)
diff --git a/lib/compare.rb b/lib/compare.rb
index 21e24df..7c182c4 100644
--- a/lib/compare.rb
+++ b/lib/compare.rb
@@ -63,6 +63,10 @@ def compare_group(argv, dimensions, options)
conditions = parse_conditions(argv)
dims = dimensions.split(' ')
groups_matrices, suites_hash, latest_jobs_hash = create_groups_matrices_list(conditions, dims)
+ unless groups_matrices
+ warn 'Empty group matrices!'
+ exit
+ end
compare_group_matrices(groups_matrices, suites_hash, latest_jobs_hash, options)
end
diff --git a/lib/matrix2.rb b/lib/matrix2.rb
index ab92986..5e0ad21 100644
--- a/lib/matrix2.rb
+++ b/lib/matrix2.rb
@@ -128,6 +128,8 @@ def combine_group_query_data(job_list, dims)
end
get_groups_matrix(groups, group_key, value, suites_hash, latest_jobs_hash)
end
+ return nil if groups.empty?
+
return groups, suites_hash, latest_jobs_hash
end
--
2.23.0