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

Function parseTestPlanTargets

src/utils/test-preflight.ts:190–223  ·  view source on GitHub ↗
(
  schemeContent: string,
  baseDir: string,
  fileSystemExecutor: FileSystemExecutor,
)

Source from the content-addressed store, hash-verified

188}
189
190async function parseTestPlanTargets(
191 schemeContent: string,
192 baseDir: string,
193 fileSystemExecutor: FileSystemExecutor,
194): Promise<ReferencedTestTarget[]> {
195 const targets: ReferencedTestTarget[] = [];
196 const matches = [...schemeContent.matchAll(/<TestPlanReference\s+reference\s*=\s*"([^"]+)"/g)];
197
198 for (const match of matches) {
199 const planPath = resolveContainerReference(match[1], baseDir);
200 let planContent: string;
201 try {
202 planContent = await fileSystemExecutor.readFile(planPath, 'utf8');
203 } catch {
204 continue;
205 }
206 const planJson = JSON.parse(planContent) as {
207 testTargets?: Array<{ target?: { name?: string; containerPath?: string } }>;
208 };
209
210 for (const testTarget of planJson.testTargets ?? []) {
211 const target = testTarget.target;
212 if (!target?.name) {
213 continue;
214 }
215 targets.push({
216 name: target.name,
217 containerPath: target.containerPath,
218 });
219 }
220 }
221
222 return targets;
223}
224
225async function listDirectoryEntries(
226 directoryPath: string,

Callers 1

resolveTestPreflightFunction · 0.85

Calls 3

readFileMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected