fastlane-plugin-xcodetestcoverage 1.0.2 → 1.0.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: 28e58f915de088334b8b586ab4bcd9718da8289aad879bb67ab7bcb3ee03aa8e
|
4
|
+
data.tar.gz: 96a3e4386aec4bbe17401fefa1c37f9be5dc00d5fc22f1fce38aa3199fe69a68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6a76c7821b6d2fd0d9891b85c40828cf1d80283d0c31927d82aa7fee3dce2c159adaffe8c7d82024d3302147af84e2f8eb8ee681afa4edb95673bb91ca60c89
|
7
|
+
data.tar.gz: 2c46b94fde49c93fdf9fe6b1e9c1950adf9d718a8f9d1f5d75e87e826faacd2cced3cf9093d818da5351f9391fdd1a617cb5403bc469e7a5f710d31709dcd356
|
data/README.md
CHANGED
@@ -38,6 +38,8 @@ type: Proc
|
|
38
38
|
|
39
39
|
coverageExceptionCallback - Optional coverage exception callback argument" optional: true, type: Proc
|
40
40
|
|
41
|
+
xcresultPath - alternative path to xcresult, optional: true, type: String
|
42
|
+
|
41
43
|
## Example
|
42
44
|
|
43
45
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane tests`.
|
@@ -62,7 +64,13 @@ xcodetestcoverage(minimumCoveragePercentage: 45.0,
|
|
62
64
|
}
|
63
65
|
)
|
64
66
|
```
|
65
|
-
|
67
|
+
You can use alternative path to xcresult. In this case, running a test via fastlane (with the command scan or run_tests) before xcodetestcoverage is optional.
|
68
|
+
```bash
|
69
|
+
reportPath = "test.xcresult"
|
70
|
+
xcodetestcoverage(minimumCoveragePercentage: 30.0,
|
71
|
+
enableDataFailedException: true,
|
72
|
+
xcresultPath: reportPath)
|
73
|
+
```
|
66
74
|
|
67
75
|
## Issues and Feedback
|
68
76
|
|
@@ -8,12 +8,15 @@ module Fastlane
|
|
8
8
|
enableDataFailedException = params[:enableDataFailedException]
|
9
9
|
minimumCoveragePercentage = params[:minimumCoveragePercentage]
|
10
10
|
enableDefaultCoverageException = params[:enableDefaultCoverageException]
|
11
|
+
filePath = params[:xcresultPath]
|
11
12
|
lineCoverage = nil
|
12
13
|
coveredLines = nil
|
13
14
|
executableLines = nil
|
14
15
|
|
15
|
-
filePath
|
16
|
-
|
16
|
+
if !filePath
|
17
|
+
filePath = lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]
|
18
|
+
end
|
19
|
+
|
17
20
|
if filePath && File.exists?(filePath)
|
18
21
|
jsonResult = sh "xcrun xccov view --only-targets --report '#{filePath}' --json"
|
19
22
|
if lineCoverageMatch = jsonResult.match('.*lineCoverage":(\d+.\d+).*')
|
@@ -101,7 +104,14 @@ module Fastlane
|
|
101
104
|
key: :coverageExceptionCallback,
|
102
105
|
description: "Optional coverage exception callback argument",
|
103
106
|
optional: true,
|
104
|
-
type: Proc)
|
107
|
+
type: Proc),
|
108
|
+
|
109
|
+
FastlaneCore::ConfigItem.new(
|
110
|
+
key: :xcresultPath,
|
111
|
+
env_name: "XCODETESTCOVERAGE_XCRESULTPATH",
|
112
|
+
description: "Alternative path to xcresult",
|
113
|
+
type: String,
|
114
|
+
optional: true)
|
105
115
|
]
|
106
116
|
end
|
107
117
|
|