Giter VIP home page Giter VIP logo

Comments (16)

sanao1006 avatar sanao1006 commented on June 6, 2024 1

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.

Jaehwa-Noh avatar Jaehwa-Noh commented on June 6, 2024 1

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.

sanao1006 avatar sanao1006 commented on June 6, 2024 1

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.

Jaehwa-Noh avatar Jaehwa-Noh commented on June 6, 2024 1

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.

SimonMarquis avatar SimonMarquis commented on June 6, 2024 1

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.

Jaehwa-Noh avatar Jaehwa-Noh commented on June 6, 2024 1

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.

SimonMarquis avatar SimonMarquis commented on June 6, 2024 1

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.

takahirom avatar takahirom commented on June 6, 2024 1

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.

hoisie avatar hoisie commented on June 6, 2024 1

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.

JackEblan avatar JackEblan commented on June 6, 2024

@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.

SimonMarquis avatar SimonMarquis commented on June 6, 2024

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.

hoisie avatar hoisie commented on June 6, 2024

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.

hoisie avatar hoisie commented on June 6, 2024

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.

SimonMarquis avatar SimonMarquis commented on June 6, 2024

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.

SimonMarquis avatar SimonMarquis commented on June 6, 2024

Renders with Windows runners are different for the NavigationBar / NavigationRail tests:

SimonMarquis@6e4e7b5

Screenshots
compactWidth_compactHeight_showsNavigationBar_compare
compactWidth_expandedHeight_showsNavigationBar_compare
compactWidth_mediumHeight_showsNavigationBar_compare
expandedWidth_compactHeight_showsNavigationRail_compare

from nowinandroid.

SimonMarquis avatar SimonMarquis commented on June 6, 2024

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)

// Configure user data
runBlocking {
userDataRepository.setShouldHideOnboarding(true)
userDataRepository.setFollowedTopicIds(
setOf(topicsRepository.getTopics().first().first().id),
)
}

from nowinandroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.