-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug] Unit test failures on main branch #27269
[Bug] Unit test failures on main branch #27269
Comments
Right, these are Windows-specific path separator issues. The wallpaper tests are fixed with: diff --git a/app/src/main/java/org/mozilla/fenix/wallpapers/WallpaperDownloader.kt b/app/src/main/java/org/mozilla/fenix/wallpapers/WallpaperDownloader.kt
index d0ecc4252..c5b298997 100644
--- a/app/src/main/java/org/mozilla/fenix/wallpapers/WallpaperDownloader.kt
+++ b/app/src/main/java/org/mozilla/fenix/wallpapers/WallpaperDownloader.kt
@@ -80,7 +80,7 @@ class WallpaperDownloader(
if (!response.isSuccess) {
throw IllegalStateException()
}
- File(localFile.path.substringBeforeLast("/")).mkdirs()
+ localFile.parentFile!!.mkdirs()
response.body.useStream { input ->
input.copyTo(localFile.outputStream())
} The first is due to Android's |
To ensure the slashes are compatible with all platforms we should use |
…tion This fixes gradle tests on Windows, where the file separator is "\" and not "/".
@Mugurell I made a PR for the wallpaper tests.
In this case, the error actually arises because A-C's Possible solutions:
|
…tion This fixes gradle tests on Windows, where the file separator is "\" and not "/".
This fixes gradle tests on Windows, where the file separator is "\" and not "/".
…bstring extraction This fixes gradle tests on Windows, where the file separator is "\" and not "/".
If these aren't showing up for others, then this may well be a Windows-specific issue.
Using
./gradlew testDebugUnitTest --tests org.mozilla.fenix.downloads*
:From
SUITE: org.mozilla.fenix.downloads.DynamicDownloadDialogTest
:Using
./gradlew testDebugUnitTest --tests org.mozilla.fenix.wallpaper*
:From
SUITE: org.mozilla.fenix.wallpapers.WallpaperDownloaderTest
:┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: