1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 21:00:10 +01:00
Mike Linksvayer da8b1d2194 Throttle concurrency of html link checker
spdx.org obtains 503 if too many connections opened, it seems eg
https://travis-ci.org/github/choosealicense.com/builds/439831256

Problem goes away locally when html-proofer/typhoeus/hydra default
changed from 200 to 10
2018-10-19 11:55:08 +02:00

35 lines
1.0 KiB
Ruby

# frozen_string_literal: true
require 'html-proofer'
require 'rspec/core/rake_task'
desc 'Run specs'
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = ['--order', 'rand', '--color']
end
task :test do
sh 'bundle exec jekyll build'
Rake::Task['spec'].invoke
HTMLProofer.check_directory('./_site',
check_html: true,
validation: { ignore_script_embeds: true },
url_swap: { %r{https://choosealicense.com} => '' },
hydra: { max_concurrency: 10 },
check_img_http: true).run
end
task :approved_licenses do
require './spec/spec_helper'
approved = approved_licenses
approved.select! { |l| spdx_ids.include?(l) }
puts "#{approved.count} approved licenses:"
puts approved.join(', ')
puts "\n"
potential = approved - (licenses.map { |l| l['id'] })
puts "#{potential.count} potential additions:"
puts potential.join(', ')
end