Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always download the common test suite before running tests #387

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]