Skip to content

Commit

Permalink
Always download the common test suite before running tests
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
iainbeeston committed Jul 5, 2017
1 parent 3c50306 commit 8b434c9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ 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

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
Expand Down Expand Up @@ -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]

0 comments on commit 8b434c9

Please sign in to comment.