Skip to content

Commit 2e04edd

Browse files
spilistthymikee
andauthored
fix: prevent runner XCTest attachment bloat (#520)
Long-running AgentDeviceRunnerUITests sessions can inherit Xcode 26 screenRecording/deleteOnSuccess defaults and leave hidden testmanagerd attachments behind when sessions terminate outside a clean XCTest success path. Pin an explicit AgentDeviceRunnerUITests.xctestplan with screenshots and keepNever attachment lifetimes, then normalize the generated per-session .xctestrun copy before test-without-building. The .xctestrun normalization protects stale cached artifacts and Xcode versions that ignore some test-plan attachment lifetime keys during build-for-testing. This only affects XCTest's automatic attachments; user-requested agent-device recordings still use the existing record command paths. Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
1 parent d12d27d commit 2e04edd

5 files changed

Lines changed: 350 additions & 160 deletions

File tree

.fallowrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
"website/docs/404.mdx",
2323
"website/rspress.config.ts"
2424
],
25-
"ignorePatterns": ["examples/test-app/**"],
25+
"ignorePatterns": [
26+
"examples/test-app/**",
27+
"ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests.xctestplan"
28+
],
2629
"ignoreDependencies": ["@theme"],
2730
"ignoreExports": [
2831
{

ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/xcshareddata/xcschemes/AgentDeviceRunner.xcscheme

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2929
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
3030
shouldUseLaunchSchemeArgsEnv = "YES"
31-
shouldAutocreateTestPlan = "YES">
31+
shouldAutocreateTestPlan = "NO">
32+
<TestPlans>
33+
<TestPlanReference
34+
reference = "container:AgentDeviceRunnerUITests.xctestplan"
35+
default = "YES">
36+
</TestPlanReference>
37+
</TestPlans>
3238
<Testables>
3339
<TestableReference
3440
skipped = "NO"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "916C7049-FE79-4C78-B55F-79242F92CB19",
5+
"name" : "Configuration 1",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"preferredScreenCaptureFormat" : "screenshots",
13+
"systemAttachmentLifetime" : "keepNever",
14+
"userAttachmentLifetime" : "keepNever"
15+
},
16+
"testTargets" : [
17+
{
18+
"target" : {
19+
"containerPath" : "container:AgentDeviceRunner.xcodeproj",
20+
"identifier" : "20EA2EDC2F2CFC7C001CF0EF",
21+
"name" : "AgentDeviceRunnerUITests"
22+
}
23+
}
24+
],
25+
"version" : 1
26+
}

0 commit comments

Comments
 (0)