Disable running upstream test suite
Closes: #905648, #1019646, #1017218
Antonio Terceiro
1 year, 2 months ago
0 | 0 |
require 'gem2deb/rake/spectask'
|
1 | 1 |
|
|
2 |
# Upstream recommended to disable running the test suite, and everytime we try
|
|
3 |
# to run it again, sooner or later we get FTBFS bugs due to random failures.
|
|
4 |
# Instead of running the upstream test suite, let's run just some very basic
|
|
5 |
# smoke tests of our own.
|
|
6 |
#
|
|
7 |
# Links:
|
|
8 |
# https://github.com/grosser/parallel/issues/227
|
|
9 |
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905648
|
|
10 |
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019646
|
|
11 |
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017218
|
2 | 12 |
Gem2Deb::Rake::RSpecTask.new do |spec|
|
3 | |
spec.pattern = './spec/**/*_spec.rb'
|
|
13 |
spec.pattern = 'debian/tests/*_spec.rb'
|
4 | 14 |
end
|
5 | |
|
6 | |
task :default
|
7 | |
require "parallel"
|
8 | |
puts "can load parallel gem"
|
9 | |
|
|
0 |
require 'etc'
|
|
1 |
require 'benchmark'
|
|
2 |
require 'parallel'
|
|
3 |
|
|
4 |
describe 'Parallel' do
|
|
5 |
it 'works for a simple case' do
|
|
6 |
skip if Etc.nprocessors < 2
|
|
7 |
sequential = Benchmark.measure { (0..100).each { sleep 0.01} }
|
|
8 |
parallel = Benchmark.measure { Parallel.each(0..100) { sleep 0.01} }
|
|
9 |
expect(parallel.real).to be < sequential.real
|
|
10 |
end
|
|
11 |
end
|