-
Notifications
You must be signed in to change notification settings - Fork 11
/
step.yml
178 lines (146 loc) · 5.42 KB
/
step.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
title: "Shard XCode Test Target"
summary: "Shard XCode Test Target into multiple equal sized XCode Test Plans"
description: |-
# Bitrise Test Plan Sharder step
This step can be used to automatically create equal sized XCode Test Plans from a XCode Test Target.
This step will modify your XCode Project & XCode Scheme to add the generated Test Plans.
These Test Plans can then be run in parallel in fan out builds.
## Prerequisites
- NodeJS - https://nodejs.org/en/download/
To verify your NodeJS Installation run:
`node -v`
You should see something like this printed if it was successful:
`v12.13.0`
## Run Step Locally
To run this step locally you will need to set the inputs using Enviroment Variables
**Enviroment Variables**
```
export SOURCE_DIR="/User/var/git/ios"
export XCODE_PROJECT="Notes.xcodeproj"
export SHARDS=2
export TARGET="Notes"
export SCHEME="NotesUITests"
export DEBUG="false"
```
**Running**
From the folder you downloaded this code open the terminal and run:
`node index.js`
**Note:** This will modify your XCode Project & XCode Scheme to add the newly created Test Plans.
## Input variables
**Path to XCode Project** (required)
* **Description:** This is the location of your xcode project
* **Example:** `$BITRISE_SOURCE_DIR/ios`
**XCode Project** (required)
* **Description:** XCode Project name
* **Example:** `Notes.xcodeproj`
**XCode Target** (required)
* **Description:** The XCode Target to create Test Plans from
* **Example:** `NotesUITests`
**XCode Test Plan name** (optional)
* **Description:** The XCode Test Plan already in your project you want to shard. The file should be referenced relative to the XCode Project Path setting
* **Example:** `Notes.xctestplan`
**XCode Scheme** (required)
* **Description:** The XCode Scheme to test
* **Example:** `Notes`
**How many Test Plans to create (required)**
* **Description:** The number of Test Plans to generate
* **Example:** `2`
**Debug**
* **Description:** Create verbose debug logs
* **Example:** YES / NO
**Parallelizable**
* **Description:** Allow shards to run tests with multiple simulators in parallel
* **Example:** YES / NO
## Outputs
**TEST_PLANS**
* **Description:** List of Test Plans Created
* **Example:** `"TestShard_1.xctestplan","TestShard_2.xctestplan"`
website: https://github.com/DamienBitrise/bitrise-test-plan-sharder
source_code_url: https://github.com/DamienBitrise/bitrise-test-plan-sharder
support_url: https://github.com/DamienBitrise/bitrise-test-plan-sharder/issues
host_os_tags:
- osx-10.10
- ubuntu-16.04
type_tags:
- test
project_type_tags:
- ios
is_always_run: false
is_skippable: false
inputs:
- path_to_xcode: $BITRISE_SOURCE_DIR
opts:
title: Path to xcode project no trailing slash
summary: Location of your XCode Project
description: This is the location and name of your xcode project
is_required: true
is_sensitive: false
- xcode_project:
opts:
title: XCode Project
summary: XCode Project name
description: This is the name of your xcode project
is_required: true
is_sensitive: false
- target:
opts:
title: XCode Target or Test Plan name
summary: The XCode Target or Test Plans to shard
description: The XCode Target or Test Plan will be used to create shards
is_required: true
is_sensitive: false
- test_path:
opts:
title: Path where your test target tests are located
summary: The path to the test cases in the file system
description: All your test target test class files should be in this folder
is_required: false
is_sensitive: false
- test_plan:
opts:
title: (Optional) XCode Test Plan name
summary: The XCode Test Plans to shard if you do not have test plans enabled leave this blank. Note You will need to replace the existing test plan with the test plan shard in your fan out builds. eg. cp TestShard_0.xctestplan Notes.xctestplan
description: The XCode Test Plan will be used to create shards if one is specified
is_required: false
is_sensitive: false
- scheme:
opts:
title: XCode Scheme
summary: The XCode Scheme to test
description: The Test Plans will be added to this XCode Scheme
is_required: true
is_sensitive: false
- shards:
opts:
title: How many Test Plans to create
summary: The number of Test Plans to generate
description: This will create Test Plans containing equal numbers of test cases
is_required: true
is_sensitive: false
- debug_mode: "false"
opts:
category: Debug
title: "Enable Debug Mode"
summary: The step will print more verbose logs if enabled.
description: The step will print more verbose logs if enabled.
is_required: true
is_sensitive: false
value_options:
- "false"
- "true"
- parallelizable: "false"
opts:
title: "Enable Simulator Parallelization"
summary: Each shard will run its tests in parallel if enabled.
description: Each shard will run its tests in parallel if enabled.
is_required: true
is_sensitive: false
value_options:
- "false"
- "true"
outputs:
- TEST_PLANS:
opts:
title: List of Test Plans Created
summary: List of Test Plans Created
description: List of Test Plans Created