firespring_dev_commands 2.1.21.pre.alpha.1 → 2.1.21.pre.alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ad8131b620682ed6d6e9b496934646615c3aca3c0656886a624e03c73f0041
|
4
|
+
data.tar.gz: 936887064f1e8e3c71193af00a105b3808ede716b5bf72cc959c7db63d459ac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89cd73bbf3342e5ff66a9762311bfd07a5c78f18aa7dc92d3edaef96d55277054a887b011b672a3a9d2689870a98c1a1784ee5061f6539bba8a95856fe86d095
|
7
|
+
data.tar.gz: e0a8077e578697502912063cdf9004d21c993cb32b54cbfb46b158f59b7f7a37ac6362358606070451113ead000bf7759859999cc9818eddbbeba7cdda43965f
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Dev
|
2
|
+
# Module containing different classes for interfacing with coverage files
|
2
3
|
module Coverage
|
4
|
+
# Class for checking code coverage using cobertura
|
3
5
|
class Cobertura
|
4
6
|
attr_reader :local_filename, :container_filename, :filename, :threshold
|
5
7
|
|
@@ -8,15 +10,18 @@ module Dev
|
|
8
10
|
@local_filename = File.join(local_path || '.', @filename)
|
9
11
|
@container_filename = File.join(container_path || '.', @filename)
|
10
12
|
@threshold = threshold.to_f
|
13
|
+
end
|
11
14
|
|
15
|
+
# Remove any previous versions of the local file that will be output
|
16
|
+
# return the phpunit options needed to regenerate the cobertura xml file
|
17
|
+
def php_options
|
12
18
|
# Remove any previous coverage info
|
13
19
|
FileUtils.rm_f(local_filename, verbose: true)
|
14
|
-
end
|
15
20
|
|
16
|
-
def options
|
17
21
|
%W(--coverage-cobertura #{container_filename})
|
18
22
|
end
|
19
23
|
|
24
|
+
# Parse the cobertura file as a hash and check the total coverage against the desired threshold
|
20
25
|
def check
|
21
26
|
report = Ox.load(File.read(local_filename), mode: :hash)
|
22
27
|
attrs, = report[:coverage]
|
@@ -95,11 +95,16 @@ module Dev
|
|
95
95
|
def test_command
|
96
96
|
test = []
|
97
97
|
test << './vendor/bin/phpunit'
|
98
|
-
test << coverage.
|
98
|
+
test << coverage.php_options if coverage
|
99
99
|
test.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
100
100
|
test
|
101
101
|
end
|
102
102
|
|
103
|
+
# Run the check to ensure code coverage meets the desired threshold
|
104
|
+
def check_test_coverage
|
105
|
+
coverage.check
|
106
|
+
end
|
107
|
+
|
103
108
|
# Build the php fast test command
|
104
109
|
def test_fast_command(processes = 4)
|
105
110
|
test = []
|