Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Support for .xctestrun File Format Version 2 #559

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5039b87
Initial commit - Support of xctestrun v2
bahrimootaz Feb 5, 2025
ecc2a59
PoC with reset listener
bahrimootaz Feb 6, 2025
c556747
PoC with reset listener
bahrimootaz Feb 6, 2025
cb937d8
Run both XCTest And XCUITEST
bahrimootaz Feb 6, 2025
cce1e4a
Run both XCTest And XCUITEST
bahrimootaz Feb 6, 2025
8280396
use the UITargetAppPath to grab the bundle id of the target app
bahrimootaz Feb 6, 2025
f107fa9
remove prints
bahrimootaz Feb 7, 2025
f13cc2e
Polish code for iterating over configs
si-net Feb 7, 2025
d2be18c
Parse xctstrun v2 and trigger all test configuration
bahrimootaz Feb 7, 2025
aa34bb6
Remove obsolete fies
si-net Feb 7, 2025
df26dd9
Remvoe more obsolete files
si-net Feb 7, 2025
cce2c3a
Obsolete changes
si-net Feb 7, 2025
47c8d13
Merge branch 'main' into polish-code
si-net Feb 7, 2025
7062b58
Merge pull request #2 from bahrimootaz/polish-code
bahrimootaz Feb 7, 2025
7654fed
Allow UI tests to run without a target app. For example, WebDriverAge…
bahrimootaz Feb 7, 2025
d94ca21
Remove unnecessary test
bahrimootaz Feb 7, 2025
a9d80bf
Revert "Remove unnecessary test"
bahrimootaz Feb 7, 2025
a4071c3
Enforce stricter checks for XCTestrun format version 2: Added restric…
bahrimootaz Feb 7, 2025
fc2aa6f
Avoid returning a empty string when we can't locate the bundleId
bahrimootaz Feb 7, 2025
d778d1e
Merge branch 'danielpaulus:main' into main
bahrimootaz Feb 10, 2025
a3ed259
Update ios/testmanagerd/xctestrunutils.go
bahrimootaz Feb 10, 2025
e1ad011
Update ios/testmanagerd/xctestrunutils.go
bahrimootaz Feb 10, 2025
d318f8c
resolve threads
bahrimootaz Feb 10, 2025
32af7a5
allow partial failure while running xctest
bahrimootaz Feb 10, 2025
e0a66e8
revert support for xcuitest through xctestrun file
bahrimootaz Feb 10, 2025
81b600d
revert support for xcuitest through xctestrun file - 2
bahrimootaz Feb 10, 2025
e2b7cea
revert support for xcuitest through xctestrun file - 3
bahrimootaz Feb 10, 2025
d612f97
Remove unneeded xcuitest change
si-net Feb 10, 2025
060e842
Merge pull request #3 from bahrimootaz/remove-unneeded-change
bahrimootaz Feb 10, 2025
0ab1b8e
Skip XCUITest when running xctestrun files
si-net Feb 10, 2025
7f4f494
Merge pull request #4 from bahrimootaz/skip-xcuitests
bahrimootaz Feb 10, 2025
8647066
Reset Testlistener at correct place
si-net Feb 10, 2025
dd91b59
Merge pull request #6 from bahrimootaz/fix-testlistener-signalling
bahrimootaz Feb 10, 2025
7dfa02c
Refactor xctestrunutils test
si-net Feb 10, 2025
ff3e730
Merge pull request #7 from bahrimootaz/refactor-tests
bahrimootaz Feb 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
278 changes: 278 additions & 0 deletions ios/testmanagerd/testdata/format_version_2.xctestrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CodeCoverageBuildableInfos</key>
<array>
<dict>
<key>Architectures</key>
<array>
<string>arm64</string>
</array>
<key>BuildableIdentifier</key>
<string>506AF5D12D429D9E008E829B:primary</string>
<key>IncludeInReport</key>
<true/>
<key>IsStatic</key>
<false/>
<key>Name</key>
<string>FakeCounterApp.app</string>
<key>ProductPaths</key>
<array>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app/FakeCounterApp</string>
</array>
<key>SourceFiles</key>
<array>
<string>CounterView.swift</string>
<string>CounterViewModel.swift</string>
<string>FakeCounterApp.swift</string>
</array>
<key>SourceFilesCommonPathPrefix</key>
<string>/Users/mootazbahri/Desktop/apps/rdc-xcuitest-test/app_sources/FakeCounterApp/FakeCounterApp/</string>
<key>Toolchains</key>
<array>
<string>com.apple.dt.toolchain.XcodeDefault</string>
</array>
</dict>
<dict>
<key>Architectures</key>
<array>
<string>arm64</string>
</array>
<key>BuildableIdentifier</key>
<string>506AF5E12D429DA0008E829B:primary</string>
<key>IncludeInReport</key>
<true/>
<key>IsStatic</key>
<false/>
<key>Name</key>
<string>FakeCounterAppTests.xctest</string>
<key>ProductPaths</key>
<array>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app/PlugIns/FakeCounterAppTests.xctest/FakeCounterAppTests</string>
</array>
<key>SourceFiles</key>
<array>
<string>CounterXCTests.swift</string>
<string>SkippedTests.swift</string>
</array>
<key>SourceFilesCommonPathPrefix</key>
<string>/Users/mootazbahri/Desktop/apps/rdc-xcuitest-test/app_sources/FakeCounterApp/FakeCounterAppXCTests/</string>
<key>Toolchains</key>
<array>
<string>com.apple.dt.toolchain.XcodeDefault</string>
</array>
</dict>
<dict>
<key>Architectures</key>
<array>
<string>arm64</string>
</array>
<key>BuildableIdentifier</key>
<string>506AF5EB2D429DA0008E829B:primary</string>
<key>IncludeInReport</key>
<true/>
<key>IsStatic</key>
<false/>
<key>Name</key>
<string>FakeCounterAppUITests.xctest</string>
<key>ProductPaths</key>
<array>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app/PlugIns/FakeCounterAppUITests.xctest/FakeCounterAppUITests</string>
</array>
<key>SourceFiles</key>
<array>
<string>/Users/mootazbahri/Desktop/apps/rdc-xcuitest-test/app_sources/FakeCounterApp/FakeCounterAppUITests/CounterUITests.swift</string>
</array>
<key>Toolchains</key>
<array>
<string>com.apple.dt.toolchain.XcodeDefault</string>
</array>
</dict>
</array>
<key>ContainerInfo</key>
<dict>
<key>ContainerName</key>
<string>FakeCounterApp</string>
<key>SchemeName</key>
<string>FakeCounterAppTest</string>
</dict>
<key>TestConfigurations</key>
<array>
<dict>
<key>Name</key>
<string>Test Scheme Action</string>
<key>TestTargets</key>
<array>
<dict>
<key>BlueprintName</key>
<string>FakeCounterAppTests</string>
<key>BlueprintProviderName</key>
<string>FakeCounterApp</string>
<key>BlueprintProviderRelativePath</key>
<string>FakeCounterApp.xcodeproj</string>
<key>BundleIdentifiersForCrashReportEmphasis</key>
<array>
<string>saucelabs.FakeCounterApp</string>
<string>saucelabs.FakeCounterAppUITests</string>
</array>
<key>ClangProfileDataDirectoryPath</key>
<string>__DERIVEDDATA__/Build/ProfileData</string>
<key>CommandLineArguments</key>
<array/>
<key>DefaultTestExecutionTimeAllowance</key>
<integer>600</integer>
<key>DependentProductPaths</key>
<array>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app/PlugIns/FakeCounterAppTests.xctest</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app/PlugIns/FakeCounterAppUITests.xctest</string>
</array>
<key>DiagnosticCollectionPolicy</key>
<integer>1</integer>
<key>EnvironmentVariables</key>
<dict>
<key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
<string>com.apple.AppStore</string>
<key>OS_ACTIVITY_DT_MODE</key>
<string>YES</string>
<key>SQLITE_ENABLE_THREAD_ASSERTIONS</key>
<string>1</string>
<key>TERM</key>
<string>dumb</string>
</dict>
<key>IsAppHostedTestBundle</key>
<true/>
<key>ParallelizationEnabled</key>
<true/>
<key>PreferredScreenCaptureFormat</key>
<string>screenRecording</string>
<key>ProductModuleName</key>
<string>FakeCounterAppTests</string>
<key>SkipTestIdentifiers</key>
<array>
<string>SkippedTests</string>
<string>SkippedTests/testThatAlwaysFailsAndShouldBeSkipped</string>
</array>
<key>SystemAttachmentLifetime</key>
<string>deleteOnSuccess</string>
<key>TestBundlePath</key>
<string>__TESTHOST__/PlugIns/FakeCounterAppTests.xctest</string>
<key>TestHostBundleIdentifier</key>
<string>saucelabs.FakeCounterApp</string>
<key>TestHostPath</key>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app</string>
<key>TestLanguage</key>
<string></string>
<key>TestRegion</key>
<string></string>
<key>TestTimeoutsEnabled</key>
<false/>
<key>TestingEnvironmentVariables</key>
<dict>
<key>DYLD_INSERT_LIBRARIES</key>
<string>__TESTHOST__/Frameworks/libXCTestBundleInject.dylib</string>
<key>XCInjectBundleInto</key>
<string>unused</string>
</dict>
<key>ToolchainsSettingValue</key>
<array/>
<key>UserAttachmentLifetime</key>
<string>deleteOnSuccess</string>
</dict>
<dict>
<key>BlueprintName</key>
<string>FakeCounterAppUITests</string>
<key>BlueprintProviderName</key>
<string>FakeCounterApp</string>
<key>BlueprintProviderRelativePath</key>
<string>FakeCounterApp.xcodeproj</string>
<key>BundleIdentifiersForCrashReportEmphasis</key>
<array>
<string>saucelabs.FakeCounterApp</string>
<string>saucelabs.FakeCounterAppUITests</string>
</array>
<key>ClangProfileDataDirectoryPath</key>
<string>__DERIVEDDATA__/Build/ProfileData</string>
<key>CommandLineArguments</key>
<array/>
<key>DefaultTestExecutionTimeAllowance</key>
<integer>600</integer>
<key>DependentProductPaths</key>
<array>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app/PlugIns/FakeCounterAppTests.xctest</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app</string>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app/PlugIns/FakeCounterAppUITests.xctest</string>
</array>
<key>DiagnosticCollectionPolicy</key>
<integer>1</integer>
<key>EnvironmentVariables</key>
<dict>
<key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
<string>com.apple.AppStore</string>
<key>OS_ACTIVITY_DT_MODE</key>
<string>YES</string>
<key>SQLITE_ENABLE_THREAD_ASSERTIONS</key>
<string>1</string>
<key>TERM</key>
<string>dumb</string>
</dict>
<key>IsUITestBundle</key>
<true/>
<key>IsXCTRunnerHostedTestBundle</key>
<true/>
<key>ParallelizationEnabled</key>
<true/>
<key>PreferredScreenCaptureFormat</key>
<string>screenRecording</string>
<key>ProductModuleName</key>
<string>FakeCounterAppUITests</string>
<key>SystemAttachmentLifetime</key>
<string>deleteOnSuccess</string>
<key>TestBundlePath</key>
<string>__TESTHOST__/PlugIns/FakeCounterAppUITests.xctest</string>
<key>TestHostBundleIdentifier</key>
<string>saucelabs.FakeCounterAppUITests.xctrunner</string>
<key>TestHostPath</key>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterAppUITests-Runner.app</string>
<key>TestLanguage</key>
<string></string>
<key>TestRegion</key>
<string></string>
<key>TestTimeoutsEnabled</key>
<false/>
<key>TestingEnvironmentVariables</key>
<dict/>
<key>ToolchainsSettingValue</key>
<array/>
<key>UITargetAppCommandLineArguments</key>
<array/>
<key>UITargetAppEnvironmentVariables</key>
<dict>
<key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
<string>com.apple.AppStore</string>
</dict>
<key>UITargetAppPath</key>
<string>__TESTROOT__/Debug-iphoneos/FakeCounterApp.app</string>
<key>UserAttachmentLifetime</key>
<string>deleteOnSuccess</string>
</dict>
</array>
</dict>
</array>
<key>TestPlan</key>
<dict>
<key>IsDefault</key>
<true/>
<key>Name</key>
<string>FakeAppTestPlan</string>
</dict>
<key>__xctestrun_metadata__</key>
<dict>
<key>FormatVersion</key>
<integer>2</integer>
</dict>
</dict>
</plist>
8 changes: 8 additions & 0 deletions ios/testmanagerd/testlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,11 @@ func (t *TestListener) executionFinished() {
close(t.finished)
})
}

func (t *TestListener) reset() {
// Reinitialize finished channel to allow signaling again
t.finished = make(chan struct{})

// Reset the sync.Once instance so it can be used again
t.finishedOnce = sync.Once{}
}
Loading
Loading