Breaking comparsion step out into separate task

This commit is contained in:
Arfon Smith
2014-07-08 21:13:52 -05:00
parent 24fb5a8e29
commit 973431be40

View File

@@ -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