MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / createTestSimExecutor

Function createTestSimExecutor

src/mcp/tools/simulator/test_sim.ts:190–250  ·  view source on GitHub ↗
(
  executor: CommandExecutor,
  fileSystemExecutor: FileSystemExecutor = getDefaultFileSystemExecutor(),
  prepared?: PreparedTestSimExecution,
)

Source from the content-addressed store, hash-verified

188}
189
190export function createTestSimExecutor(
191 executor: CommandExecutor,
192 fileSystemExecutor: FileSystemExecutor = getDefaultFileSystemExecutor(),
193 prepared?: PreparedTestSimExecution,
194): StreamingExecutor<TestSimulatorParams, TestSimulatorResult> {
195 return async (params, ctx) => {
196 const resolved =
197 prepared ?? (await prepareTestSimExecution(params, executor, fileSystemExecutor));
198
199 if (resolved.warningMessage) {
200 log('warn', resolved.warningMessage);
201 ctx.emitFragment({
202 kind: 'test-result',
203 fragment: 'warning',
204 message: resolved.warningMessage,
205 });
206 }
207
208 if (resolved.resolutionError || !resolved.resolvedSimulatorId) {
209 const started = createDomainStreamingPipeline('test_sim', 'TEST', ctx, 'test-result');
210 return createTestDomainResult({
211 started,
212 succeeded: false,
213 target: 'simulator',
214 artifacts: {
215 buildLogPath: started.pipeline.logPath,
216 },
217 fallbackErrorMessages: [
218 resolved.resolutionError ?? 'Failed to resolve simulator identifier for test execution.',
219 ],
220 request: resolved.invocationRequest,
221 });
222 }
223
224 const executeTest = createTestExecutor(executor, {
225 preflight: resolved.preflight,
226 toolName: 'test_sim',
227 target: 'simulator',
228 request: resolved.invocationRequest,
229 });
230
231 return executeTest(
232 {
233 projectPath: params.projectPath,
234 workspacePath: params.workspacePath,
235 scheme: params.scheme,
236 simulatorId: resolved.resolvedSimulatorId,
237 simulatorName: params.simulatorName,
238 configuration: resolved.configuration,
239 derivedDataPath: params.derivedDataPath,
240 extraArgs: params.extraArgs,
241 useLatestOS: false,
242 preferXcodebuild: params.preferXcodebuild ?? false,
243 platform: resolved.platform,
244 testRunnerEnv: params.testRunnerEnv,
245 progress: params.progress,
246 },
247 ctx,

Callers 1

test_simLogicFunction · 0.85

Calls 7

logFunction · 0.90
createTestDomainResultFunction · 0.90
createTestExecutorFunction · 0.90
prepareTestSimExecutionFunction · 0.85
emitFragmentMethod · 0.65

Tested by

no test coverage detected