From 8b434c9055ecf82f474b5376c3c63b37f2ce0bd7 Mon Sep 17 00:00:00 2001 From: Iain Beeston Date: Wed, 5 Jul 2017 09:42:15 +0100 Subject: [PATCH] Always download the common test suite before running tests In #377 I made it possible to run the tests without having internet access. But it seems that in the process I also disabled the code that downloads the common test suite when you first check out the codebase. That's bad, but what makes it worse is that travis hasn't been running the common test suite because of it. This changes the behaviour so that the tests download the common test suite (but does not update it) before running. If you don't have internet access it continues without it. To update the common test suite to the latest version, you now need to run `UPDATE_TEST_SUITE=true rake download_common_tests`. --- Rakefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Rakefile b/Rakefile index b4a13a26..991e2188 100644 --- a/Rakefile +++ b/Rakefile @@ -4,8 +4,10 @@ require 'rake/testtask' Bundler::GemHelper.install_tasks -desc "Updates the json-schema common test suite to the latest version" -task :update_common_tests do +desc "Downloads the json-schema common test suite" +task :download_common_tests do + update_test_suite = !!ENV['UPDATE_TEST_SUITE'] + unless File.read(".git/config").include?('submodule "test/test-suite"') sh "git submodule init" end @@ -13,7 +15,7 @@ task :update_common_tests do puts "Updating json-schema common test suite..." begin - sh "git submodule update --remote --quiet" + sh "git submodule update --quiet" + (update_test_suite ? " --remote" : "") rescue StandardError STDERR.puts "Failed to update common test suite." end @@ -63,6 +65,4 @@ Rake::TestTask.new do |t| t.test_files = FileList.new('test/*_test.rb') end -task update: [:update_common_tests, :update_meta_schemas] - -task :default => :test +task :default => [:download_common_tests, :test]