yast-rake 0.2.23 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tasks/test_unit.rake +41 -19
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8758e3fbdf6fe89445ab8ad1f44499a5f768eb79607a19bbb17a59e0c70644d3
|
4
|
+
data.tar.gz: 8437a6b3c4564ef99bddc6f372ff181dc798aafde2474357f9926f81e60b3c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872170f3ad82a09f91cc6b523b59fd088b803f45f9fbdb6c4f3edc33a27ad2aeaf86f465e39ef9a64f4d82291993cf9437b7a2f1e4ad4337135e30feb0966063
|
7
|
+
data.tar.gz: 43f81719151b782420793d9924941c967508472d5b5d7d293564acb1a36eab57a1bda27c3b986dfddf0a7809d0557bdf8b32823c678c629be654b551462bb8f2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.24
|
data/lib/tasks/test_unit.rake
CHANGED
@@ -12,32 +12,54 @@
|
|
12
12
|
# details.
|
13
13
|
#++
|
14
14
|
|
15
|
+
# defines $CHILD_STATUS
|
16
|
+
require "English"
|
17
|
+
|
18
|
+
def parallel_rspec_installed?
|
19
|
+
system("which parallel_rspec &> /dev/null")
|
20
|
+
end
|
21
|
+
|
22
|
+
def parallel_tests_wanted?
|
23
|
+
(File.exist?(".rspec_parallel") && ENV["PARALLEL_TESTS"] != "0") ||
|
24
|
+
ENV["PARALLEL_TESTS"] == "1"
|
25
|
+
end
|
26
|
+
|
27
|
+
def run_parallel_tests(files)
|
28
|
+
# pass custom parameters to parallel_rspec if needed,
|
29
|
+
# e.g. the number of CPUs to use
|
30
|
+
sh("parallel_rspec --verbose #{ENV["PARALLEL_TESTS_OPTIONS"]} '#{files}'")
|
31
|
+
|
32
|
+
# use coveralls for on-line code coverage reporting at Travis CI, it needs
|
33
|
+
# to be called only once, after *all* parallel tests have been finished
|
34
|
+
if ENV["COVERAGE"] && ENV["TRAVIS"] && File.exist?(".coveralls.yml")
|
35
|
+
require "coveralls/rake/task"
|
36
|
+
Coveralls::RakeTask.new
|
37
|
+
Rake::Task["coveralls:push"].invoke
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def run_sequential_tests(files)
|
42
|
+
sh("rspec --color --format doc '#{files}'")
|
43
|
+
# with standard RSpec the code coverage is usually configured in the
|
44
|
+
# test helper and is already sent at this point, no special handling
|
45
|
+
# is required
|
46
|
+
end
|
47
|
+
|
15
48
|
namespace :test do
|
16
49
|
desc "Runs unit tests."
|
17
50
|
task "unit" do
|
18
51
|
files = Dir["**/test/**/*_{spec,test}.rb"].join("' '")
|
19
52
|
next if files.empty?
|
20
53
|
|
21
|
-
# use parallel_tests if
|
22
|
-
if
|
23
|
-
|
24
|
-
|
25
|
-
# pass custom parameters to parallel_rspec if needed,
|
26
|
-
# e.g. the number of CPUs to use
|
27
|
-
sh "parallel_rspec --verbose #{ENV["PARALLEL_TESTS_OPTIONS"]} '#{files}'"
|
28
|
-
|
29
|
-
# use coveralls for on-line code coverage reporting at Travis CI, it needs
|
30
|
-
# to be called only once, after *all* parallel tests have been finished
|
31
|
-
if ENV["COVERAGE"] && ENV["TRAVIS"] && File.exist?(".coveralls.yml")
|
32
|
-
require "coveralls/rake/task"
|
33
|
-
Coveralls::RakeTask.new
|
34
|
-
Rake::Task["coveralls:push"].invoke
|
35
|
-
end
|
54
|
+
# use parallel_tests if wanted and available
|
55
|
+
if parallel_tests_wanted? && parallel_rspec_installed?
|
56
|
+
run_parallel_tests(files)
|
36
57
|
else
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
58
|
+
if parallel_tests_wanted?
|
59
|
+
$stderr.puts "WARNING: parallel tests enabled, but 'parallel_rspec' is" \
|
60
|
+
" not installed, falling back to the standard 'rspec' runner."
|
61
|
+
end
|
62
|
+
run_sequential_tests(files)
|
41
63
|
end
|
42
64
|
end
|
43
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yast-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|