Skip to content

bugfix: Fix e2e test resources android#2380

Merged
malliaridis merged 3 commits into
mainfrom
malliaridis/bugfix/e2e-test-resources-android
Jul 22, 2026
Merged

bugfix: Fix e2e test resources android#2380
malliaridis merged 3 commits into
mainfrom
malliaridis/bugfix/e2e-test-resources-android

Conversation

@malliaridis

@malliaridis malliaridis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

While executing the e2e test example on Android, I noticed that the resources were not loaded properly and the screenshots were not captured.

Additionally, from #2375 we introduced a package missmatch for JVM.

Solution

This PR addresses all these issues by using an app-specific external storage path, loads explicitly the commonMain resources as assets into the androidApp module, and updates the jvm main class package to match the correct one.

Additional Information

The fix for loading the common resources as assets into the androidApp module should be only temporary and normally handled by the korge plugin, or at least moved to the shared module's logic. However, this require more time to investigate and figure out how to do it, so I chose the quick solution for now.

You may review the fixes by opening the screenshots on the test device. They can now be found under /storage/emulated/0/Android/data/org.korge.e2e.test/files/. Before the fix they were not created (errors were logged), and with both fixes at least the Filters.png is different and is rendering the images. I am not sure what the third ping screenshot is supposed to display.

@augmentcode

augmentcode Bot commented Jul 16, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes Android e2e tests by ensuring shared resources are packaged and screenshots are written to an app-owned external storage directory.

Changes:

  • Android: adds commonMain/resources as app assets and writes screenshots under getExternalFilesDir
  • Desktop JVM: updates jvmMainClassName to match the actual entrypoint package

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


Log.d(TAG, "Determining screenshotsVfs...")
val path = Environment["OUTPUT_DIR"] ?: "."
val path = applicationContext.getExternalFilesDir(null)!!.absolutePath

@augmentcode augmentcode Bot Jul 16, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e2e/e2e-test/androidApp/src/main/kotlin/org/korge/e2e/MainActivity.kt:33getExternalFilesDir(null) can return null when external storage isn’t currently mounted; the !! will crash the e2e app and prevent screenshot capture in that case.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread e2e/e2e-test/androidApp/build.gradle.kts

@jobe-m jobe-m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Fix invalid path for android application by using an app-specific external storage path.
@malliaridis
malliaridis force-pushed the malliaridis/bugfix/e2e-test-resources-android branch from 0ff46c0 to 3e4093b Compare July 21, 2026 21:20
@malliaridis
malliaridis merged commit 23ad0f4 into main Jul 22, 2026
7 of 10 checks passed
@malliaridis
malliaridis deleted the malliaridis/bugfix/e2e-test-resources-android branch July 22, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants