You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose simulator_creator as public API for improved extensibility (#2881)
Adds a `create_simulator_action` to both iOS test runners, as well as a
`clean_up_simulator_action` to `ios_xctestrun_runner`, to provide a way
to customize how a simulator is provisioned for a test execution. This
should make it easier to support simulator pooling scenarios without
requiring users to make changes to test runner internals in a fork.
A binary that produces a UDID for a simulator that matches the given device type and OS version. The UDID will be used to run the tests on the correct simulator. The binary must print only the UDID to stdout. This is only invoked when the `$REUSE_GLOBAL_SIMULATOR` environment variable is set.
115
+
116
+
When executed, the binary will have the following environment variables available to it:
117
+
118
+
<ul>
119
+
<li>`SIMULATOR_DEVICE_TYPE`: The device type of the simulator to create. The supported types correspond to the output of `xcrun simctl list devicetypes`. E.g., iPhone 6, iPad Air. The value will either be the value of the `device_type` attribute, the `--ios_simulator_device` command-line flag, or an empty string that should imply a default device.</li>
120
+
<li>`SIMULATOR_OS_VERSION`: The os version of the simulator to create. The supported os versions correspond to the output of `xcrun simctl list runtimes`. ' 'E.g., 11.2, 9.3. The value will either be the value of the `os_version` attribute, the `--ios_simulator_version` command-line flag, or an empty string that should imply a default OS version for the selected simulator runtime.</li>
121
+
</ul>
122
+
""",
123
+
),
109
124
"device_type": attr.string(
110
125
default="",
111
126
doc="""
@@ -130,56 +145,45 @@ correspond to the output of `xcrun simctl list runtimes`. ' 'E.g., 11.2, 9.3.
130
145
By default, it is the latest supported version of the device type.'
131
146
""",
132
147
),
133
-
"test_environment": attr.string_dict(
148
+
"post_action": attr.label(
149
+
cfg="exec",
150
+
executable=True,
134
151
doc="""
135
-
Optional dictionary with the environment variables that are to be propagated
136
-
into the XCTest invocation.
152
+
A binary to run following test execution. Runs after testing but before test result handling and coverage processing. Sets the `$TEST_EXIT_CODE` environment variable, in addition to any other variables available to the test runner.
137
153
""",
138
154
),
139
-
"pre_action": attr.label(
140
-
executable=True,
141
-
cfg="exec",
155
+
"post_action_determines_exit_code": attr.bool(
156
+
default=False,
142
157
doc="""
143
-
A binary to run prior to test execution. Runs after simulator creation. Sets any environment variables available to the test runner.
158
+
When true, the exit code of the test run will be set to the exit code of the `post_action`. This is useful for tests that need to fail the test run based on their own criteria.
144
159
""",
145
160
),
146
-
"post_action": attr.label(
147
-
executable=True,
161
+
"pre_action": attr.label(
148
162
cfg="exec",
163
+
executable=True,
149
164
doc="""
150
-
A binary to run following test execution. Runs after testing but before test result handling and coverage processing. Sets the `$TEST_EXIT_CODE` environment variable, in addition to any other variables available to the test runner.
165
+
A binary to run prior to test execution. Runs after simulator creation. Sets any environment variables available to the test runner.
151
166
""",
152
167
),
153
-
"post_action_determines_exit_code": attr.bool(
154
-
default=False,
168
+
"test_environment": attr.string_dict(
155
169
doc="""
156
-
When true, the exit code of the test run will be set to the exit code of the post action. This is useful for tests that need to fail the test run based on their own criteria.
170
+
Optional dictionary with the environment variables that are to be propagated
0 commit comments