Skip to content

Commit d98bd02

Browse files
committed
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. This changes the behaviour so that if you run the test suite and you have internet access the common test suite is automatically downloaded. 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 the tests with the `UPDATE_TEST_SUITE` env var set.
1 parent 3c50306 commit d98bd02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ require 'rake/testtask'
44

55
Bundler::GemHelper.install_tasks
66

7-
desc "Updates the json-schema common test suite to the latest version"
8-
task :update_common_tests do
7+
desc "Downloads the json-schema common test suite"
8+
task :download_common_tests do
9+
update_test_suite = !!ENV['UPDATE_TEST_SUITE']
10+
911
unless File.read(".git/config").include?('submodule "test/test-suite"')
1012
sh "git submodule init"
1113
end
1214

1315
puts "Updating json-schema common test suite..."
1416

1517
begin
16-
sh "git submodule update --remote --quiet"
18+
sh "git submodule update --quiet" + (update_test_suite ? " --remote" : "")
1719
rescue StandardError
1820
STDERR.puts "Failed to update common test suite."
1921
end
@@ -63,6 +65,4 @@ Rake::TestTask.new do |t|
6365
t.test_files = FileList.new('test/*_test.rb')
6466
end
6567

66-
task update: [:update_common_tests, :update_meta_schemas]
67-
68-
task :default => :test
68+
task :default => [:download_common_tests, :test]

0 commit comments

Comments
 (0)