You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correctly parse connected Android test JUnit results after "ANDROID_SERIAL=... skip test" (#642)
* Handle connected Android test JUnit results
* Refine connected Android test result handling
* Improve connected Android JUnit result handling
1. discovery is now mode-specific rather than searching both unit-test and connected-test roots. Connected runs only look under the connected Android result folders, which avoids picking up stale output from a prior Robolectric run. also added a regression test covering that case.
2. reusing Gradle’s native JUnit XML as the source of truth, both for parsing and for staging
3. added support for variant-specific connected Android test result paths, including free/paid flavors and custom test build types, to prevent the recurring “JUnit path” error when results are not written under the default debug folder.
* Patched the parser in GradleDriver.swift so connected Android <failure> elements no longer require a message attribute. If the attribute is missing, we now use the first line of the failure body
// this allows multiple simultaneous gradle builds to take place
@@ -218,7 +229,7 @@ public struct GradleDriver {
218
229
219
230
}
220
231
221
-
iflettestResultFolder = testResultFolder{
232
+
fortestResultFolderin testResultFolders{
222
233
#if os(macOS)
223
234
try?FileManager.default.trashItem(at: testResultFolder, resultingItemURL:nil) // remove the test folder, since a build failure won't clear it and it will appear as if the tests ran successfully
throwGradleDriverError("The expected test output folder did not exist, which may indicate that the gradle process encountered a build error or other issue. Missing folder: \(testFolder.path)")
throwGradleDriverError("The expected test output folder did not exist, which may indicate that the gradle process encountered a build error or other issue. Missing folders: \(folders)")
// override test targets so we can specify "SKIP_GRADLE_TEST_TARGET=connectedDebugAndroidTest" and have the tests run against the Android emulator (e.g., using reactivecircus/android-emulator-runner@v2 with CI)
// the absense of any test data probably indicates some sort of mis-configuration or else a build failure
131
137
if testSuites.isEmpty {
132
138
XCTFail("No tests were run; this may indicate an issue with running the tests on \(deviceID ??"Robolectric"). See the test output and Report Navigator log for details.")
0 commit comments