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

Add missing proxydispatcher cases + fix productModuleName for iOS <17 #547

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
26 changes: 26 additions & 0 deletions ios/testmanagerd/proxydispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,32 @@ func (p proxyDispatcher) Dispatch(m dtx.Message) {
}

p.testListener.testCaseDidStartForClass(testClass, testMethod)
case "_XCT_testCaseDidStartWithIdentifier:iteration:":
argumentLengthErr := assertArgumentsLengthEqual(m, 2)
if argumentLengthErr != nil {
decoderErr = argumentLengthErr
break
}

testIdentifier, decoderErr := extractTestIdentifierArg(m, 0)
if decoderErr != nil {
break
}

p.testListener.testCaseDidStartForClass(testIdentifier.C[0], testIdentifier.C[1])
case "_XCT_testCaseDidStartWithIdentifier:":
argumentLengthErr := assertArgumentsLengthEqual(m, 1)
if argumentLengthErr != nil {
decoderErr = argumentLengthErr
break
}

testIdentifier, decoderErr := extractTestIdentifierArg(m, 0)
if decoderErr != nil {
break
}

p.testListener.testCaseDidStartForClass(testIdentifier.C[0], testIdentifier.C[1])
case "_XCT_testCaseDidStartWithIdentifier:testCaseRunConfiguration:":
argumentLengthErr := assertArgumentsLengthEqual(m, 2)
if argumentLengthErr != nil {
Expand Down
5 changes: 3 additions & 2 deletions ios/testmanagerd/xcuitestrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ func createTestConfigOnDevice(testSessionID uuid.UUID, info testInfo, houseArres

testBundleURL := path.Join(info.testApp.path, "PlugIns", xctestConfigFileName)

config := nskeyedarchiver.NewXCTestConfiguration(info.targetApp.bundleName, testSessionID, info.targetApp.bundleID, info.targetApp.path, testBundleURL, testsToRun, testsToSkip, isXCTest, version)
productModuleName := strings.ReplaceAll(xctestConfigFileName, ".xctest", "")
config := nskeyedarchiver.NewXCTestConfiguration(productModuleName, testSessionID, info.targetApp.bundleID, info.targetApp.path, testBundleURL, testsToRun, testsToSkip, isXCTest, version)
result, err := nskeyedarchiver.ArchiveXML(config)
if err != nil {
return "", nskeyedarchiver.XCTestConfiguration{}, err
Expand All @@ -564,7 +565,7 @@ func createTestConfigOnDevice(testSessionID uuid.UUID, info testInfo, houseArres
if err != nil {
return "", nskeyedarchiver.XCTestConfiguration{}, err
}
return xctestConfigPath, nskeyedarchiver.NewXCTestConfiguration(info.targetApp.bundleName, testSessionID, info.targetApp.bundleID, info.targetApp.path, testBundleURL, testsToRun, testsToSkip, isXCTest, version), nil
return xctestConfigPath, nskeyedarchiver.NewXCTestConfiguration(productModuleName, testSessionID, info.targetApp.bundleID, info.targetApp.path, testBundleURL, testsToRun, testsToSkip, isXCTest, version), nil
}

func createTestConfig(info testInfo, testSessionID uuid.UUID, xctestConfigFileName string, testsToRun []string, testsToSkip []string, isXCTest bool, version *semver.Version) nskeyedarchiver.XCTestConfiguration {
Expand Down
Loading