Comments (16)
Are You a Windows OS User?
Now in Android screenshot test library uses Roborazzi. This library uses Robolectric NATIVE GraphicsMode internally, but this does not support Windows OS and seems to cause the following error
java.lang.IllegalArgumentException: resource native/windows/x86_64/robolectric-nativeruntime.dll not found.
So, the local screenshot tests would fail on Windows OS.
ref: robolectric/robolectric#8312
I am not sure of the exact cause of the problem with the DataStore, but I have encountered the same error, too.
from nowinandroid.
Yes, I'm use a Windows OS.
Thank you, I didn't know Roborazzi doesn't support Windows OS.
You say, encountered same error with DataStore, it gives me relief.
from nowinandroid.
Roborazzi doesn't support Windows OS.
I think it would be correct to express that Roborazzi does not support Windows OS, but rather Robolectric NATIVE GraphicsMode does not support Windows OS!
from nowinandroid.
Yes, I agree with that.
So, the local screenshot tests would fail on Windows OS.
ref: robolectric/robolectric#8312
I checked that word from yours link.
from nowinandroid.
The issue with Roborazzi and DataStore are two different issue.
For the DataStore issue, you can read more on this issue (especially the last comment with links):
from nowinandroid.
From your Issues and relative links, I finally landed this page.
Might be the datastore problem will be solved when the next DataStore version release.
Thank you.
from nowinandroid.
Robolectric 4.11 adds support for the native runtime (native SQLite and graphics modes) on Windows.
https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12
from nowinandroid.
I was unable to reproduce this issue in roborazzi repository.
Therefore, I attempted to use the nowinandroid repository and tried fixing it with ActivityScenario.close, but it seems to be ineffective.
I also reviewed the Robolectric repository and noticed that @hoisie addressed a similar issue last week.
robolectric/robolectric@3b90118#diff-31315cbee32dff759fd6d17e6d8939e67a292dc9e6c05591e4b95462a5ef1c43R44
@hoisie
It might seem a bit abrupt, but are you aware of this?
from nowinandroid.
https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12.1 was just released which should reduce the amount of log noise in Windows (though it won't fix the underlying cause of this issue).
RE comparing screenshots across platforms (i.e. Linux / Mac / Linux):
There are no guarantees that rendering will be consistent across different platforms. The underlying native libraries (e.g. skia, minikin, etc..) have platform-specific implementation details.
from nowinandroid.
@SimonMarquis I recently tried to use Roborazzi in my app but it get stucked 😅 when I ran it on my machine. Maybe Roborazzi needs to update too or I'm the only one experiencing this.
- Windows 10
- Iguana
from nowinandroid.
Unfortunately there still seems to be issues with windows runners...
Like this one:
java.nio.file.FileSystemException: C:\Users\RUNNER~1\AppData\Local\Temp\robolectric-nativeruntime12669726669700075741\fonts\CarroisGothicSC-Regular.ttf: The process cannot access the file because it is being used by another process
https://github.com/SimonMarquis/nowinandroid/actions/runs/8488861060/job/23258373077#step:13:1
from nowinandroid.
Robolectric 4.11 adds support for the native runtime (native SQLite and graphics modes) on Windows.
https://github.com/robolectric/robolectric/releases/tag/robolectric-4.12
Just to be clear, this was a typo, and should read 4.12 release.
Windows seems to be a lot more protective of files that have been opened in native code. For instance, unlike in Mac and Linux, it's not possible to delete the temp native runtime DLL file in the same process where it was opened. We are seeing something similar with font files too. This is why we have extra cleanup logic for Windows.
from nowinandroid.
I am not sure that the FileSystemException
errors you are seeing are causing test failures:
ERROR: Failed to destroy temp directory
java.nio.file.FileSystemException: C:\Users\RUNNER~1\AppData\Local\Temp\robolectric-nativeruntime12669726669700075741\fonts\CarroisGothicSC-Regular.ttf: The process cannot access the file because it is being used by another process
This deletion logic occurs in a shutdown hook, so it would run after all tests are complete. I think we should completely remove these error messages on Windows, because they will cause a lot of noise and confusion.
I think that the tests are failing due to other reasons.
from nowinandroid.
You are probably right. I can't test it further since I don't have my Windows machine with me, but the errors seem to come from other IO Exceptions.
com.google.samples.apps.nowinandroid.ui.NiaAppScreenSizesScreenshotTests > expandedWidth_compactHeight_showsNavigationRail FAILED
java.io.IOException at SingleProcessDataStore.kt:433
Caused by: java.io.IOException at NiaAppScreenSizesScreenshotTests.kt:126
from nowinandroid.
Renders with Windows runners are different for the NavigationBar / NavigationRail tests:
Screenshots |
---|
from nowinandroid.
Could this be an issue related to Looper/Dispatcher that would not behave exactly the same?
I feel like the screenshots are not rendering the expected "state".
There are some state setup in @Before
that does not seem to be applied on Windows (hence the screenshot differences)
from nowinandroid.
Related Issues (20)
- [Testing FR] [feature:bookmarks] Add screenshot tests
- [Testing FR] [feature:bookmarks] Improve coverage of viewmodel
- [Testing FR] [feature:interests] Add screenshot tests
- [Testing FR] [feature:search] Add screenshot tests
- [Testing FR] [feature:settings] Add screenshot tests
- [Testing FR] [feature:settings] Improve ViewModel coverage
- [Testing FR] [feature:topic] Add screenshot tests
- [Testing FR] [sync:work] Improve test coverage of module
- [Testing FR] [feature:interests] Add large screen tests for 2-pane support
- [Bug]: why WithPartialCompilationAndDisabledBaselineProfile is the best result in StartupBenchmark HOT 2
- [Testing FR] [core:database] Room migration tests
- [FR]: Minimize Unnecessary Recompositions HOT 1
- [Bug]: enableEdgeToEdge() doesn't change the navigation bar color when the app is in the dark mode and the system is not in Android 14 HOT 1
- [CI] Code coverage report not shown when PR is generated from fork
- [Bug]: Current project is not applied ```android_studio``` style ktlint
- [Bug]: Bottom Bar Item is not highlighted in search
- Rename `Result` to `TaskState`
- [Bug]: App crash while scrolling the Interest category list HOT 1
- Navigation from Search to Interests HOT 1
- Wrong Search History State HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nowinandroid.