
[Why] /home/wangyong/compass-ci/lib/matrix2.rb:21:in `set_pre_value': undefined method `sum' for 1:Integer (NoMethodError) Did you mean? succ root cause: if a job has *.yaml(except job.yaml) in result_root, will meet this error when merge it to stats.json directly. [How] remove the logical handle *.yaml from lib/matrix.rb at first, we should only handle $script.yaml, and the feature will be done in other patch Signed-off-by: Lu Weitao <luweitaobe@163.com> --- lib/matrix2.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/matrix2.rb b/lib/matrix2.rb index 8444334..4dd03b4 100644 --- a/lib/matrix2.rb +++ b/lib/matrix2.rb @@ -39,21 +39,19 @@ def file_check(file) File.basename(file, '.json') when /\.json\.gz$/ File.basename(file, '.json.gz') - when /\.yaml$/ - File.basename(file, '.yaml') end end def create_stats(result_root) stats = {} - monitor_files = Dir["#{result_root}/*.{json,json.gz,yaml}"] + monitor_files = Dir["#{result_root}/*.{json,json.gz}"] monitor_files.each do |file| next unless File.size?(file) monitor = file_check(file) - next if %w[stats job].include?(monitor) + next if monitor == 'stats' extract_pre_result(stats, monitor, file) end -- 2.23.0