test(perf): cache plugin fixtures and streamline shell tests

This commit is contained in:
Peter Steinberger
2026-03-02 11:35:04 +00:00
parent cf67e374c0
commit 43bffe7bdc
3 changed files with 50 additions and 35 deletions

View File

@@ -113,7 +113,7 @@ exit 1`,
}
it("resolves fallback and preferred team IDs from provisioning profiles", async () => {
const { homeDir } = await createHomeDir();
const { homeDir, binDir } = await createHomeDir();
const profilesDir = path.join(homeDir, "Library", "MobileDevice", "Provisioning Profiles");
await mkdir(profilesDir, { recursive: true });
await writeFile(path.join(profilesDir, "one.mobileprovision"), "stub1");
@@ -126,6 +126,20 @@ exit 1`,
const preferredResult = runScript(homeDir, { IOS_PREFERRED_TEAM_ID: "BBBBB22222" });
expect(preferredResult.ok).toBe(true);
expect(preferredResult.stdout).toBe("BBBBB22222");
await writeExecutable(
path.join(binDir, "fake-python"),
`#!/usr/bin/env bash
printf 'AAAAA11111\\t0\\tAlpha Team\\r\\n'
printf 'BBBBB22222\\t0\\tBeta Team\\r\\n'`,
);
const crlfResult = runScript(homeDir, {
IOS_PYTHON_BIN: path.join(binDir, "fake-python"),
IOS_PREFERRED_TEAM_ID: "BBBBB22222",
});
expect(crlfResult.ok).toBe(true);
expect(crlfResult.stdout).toBe("BBBBB22222");
});
it("prints actionable guidance when Xcode account exists but no Team ID is resolvable", async () => {
@@ -151,21 +165,4 @@ exit 1`,
expect(result.stderr).toContain("An Apple account is signed in to Xcode");
expect(result.stderr).toContain("IOS_DEVELOPMENT_TEAM");
});
it("matches preferred team IDs even when parser output uses CRLF line endings", async () => {
const { homeDir, binDir } = await createHomeDir();
await writeExecutable(
path.join(binDir, "fake-python"),
`#!/usr/bin/env bash
printf 'AAAAA11111\\t0\\tAlpha Team\\r\\n'
printf 'BBBBB22222\\t0\\tBeta Team\\r\\n'`,
);
const result = runScript(homeDir, {
IOS_PYTHON_BIN: path.join(binDir, "fake-python"),
IOS_PREFERRED_TEAM_ID: "BBBBB22222",
});
expect(result.ok).toBe(true);
expect(result.stdout).toBe("BBBBB22222");
});
});