From 973431be4038b3ebbd60014815d6ed2cc1429472 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Tue, 8 Jul 2014 21:13:52 -0500 Subject: [PATCH] Breaking comparsion step out into separate task --- Rakefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index 52f0da46..fcc59fb5 100644 --- a/Rakefile +++ b/Rakefile @@ -67,13 +67,8 @@ namespace :benchmark do git.branch("tmp_#{reference}").delete git.branch("tmp_#{compare}").delete - # DO COMPARISON... - reference_classifications = JSON.parse(File.read("benchmark/results/#{reference}_output.json")) - - compare_classifications = JSON.parse(File.read("benchmark/results/#{compare}_output.json")) - - puts "Changes between #{reference}...#{compare}" - puts reference_classifications.deep_diff(compare_classifications) + # COMPARE AND PRINT RESULTS + Rake::Task["benchmark:results"].execute end desc "Build benchmark index" @@ -103,6 +98,18 @@ namespace :benchmark do File.open("benchmark/results/#{args[:commit]}_output.json", "w") {|f| f.write(results.to_json) } end + + desc "Compare results" + task :results do + reference, compare = ENV['compare'].split('...') + + # DO COMPARISON... + reference_classifications = JSON.parse(File.read("benchmark/results/#{reference}_output.json")) + compare_classifications = JSON.parse(File.read("benchmark/results/#{compare}_output.json")) + + puts "Changes between #{reference}...#{compare}" + puts reference_classifications.deep_diff(compare_classifications) + end end namespace :classifier do