Skip to content

Add strict mode ignore rule for wrong context usage for WV debug#6877

Merged
TimoPtr merged 3 commits into
mainfrom
feature/fail_fast_handler_instrumentation_tests
May 27, 2026
Merged

Add strict mode ignore rule for wrong context usage for WV debug#6877
TimoPtr merged 3 commits into
mainfrom
feature/fail_fast_handler_instrumentation_tests

Conversation

@TimoPtr
Copy link
Copy Markdown
Member

@TimoPtr TimoPtr commented May 21, 2026

Summary

We found out a Strict Mode issue while calling the WebView debug flag using a non UI context while running the test on Emulator.wtf this PR add an Ignore rule there.

You can see the issue https://emulator.wtf/o/a09ee3e1-05c8-4736-8790-c62326837a36/r/30b31c99-a72a-4904-b9f8-f52317c69209/j/79fc70b1-de09-429c-aadf-93bf2f0967a1?key=moYsRl9GO8Lttjtg6pebEDSjL89-Ne4USvXbmK4L

Copilot AI review requested due to automatic review settings May 21, 2026 12:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the instrumentation test setup so FailFast is configured early enough (before Application.onCreate) to avoid the default debug handler terminating the process during startup, improving integration test failure reporting.

Changes:

  • Added a custom AndroidJUnitRunner in :app and :wear androidTest sources that installs a test FailFastHandler during runner onCreate
  • Configured testInstrumentationRunner for :app and :wear to use the new runner
  • Removed the per-test FailFast override rule from LaunchActivityTest since runner-level setup now covers startup timing

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wear/src/androidTest/kotlin/io/homeassistant/companion/android/util/HAAndroidJUnitRunner.kt Adds a custom instrumentation runner that sets a test FailFastHandler before app creation
wear/build.gradle.kts Switches Wear instrumentation runner to the new custom runner
app/src/androidTest/kotlin/io/homeassistant/companion/android/util/HAAndroidJUnitRunner.kt Adds a custom instrumentation runner that sets a test FailFastHandler before app creation
app/src/androidTest/kotlin/io/homeassistant/companion/android/launch/LaunchActivityTest.kt Removes the per-test FailFast rule now made redundant by the runner-level handler
app/build.gradle.kts Switches App instrumentation runner to the new custom runner

@jpelgrom
Copy link
Copy Markdown
Member

I think you accidentally included this in #6875 - only the strict mode rule is new here. Good to merge IMO after a rebase and rename.

@TimoPtr TimoPtr changed the title Set FailFast handler at the runner level for integration test Add strict mode ignore rule for wrong context usage for WV debug May 27, 2026
@TimoPtr TimoPtr enabled auto-merge (squash) May 27, 2026 07:23
@TimoPtr TimoPtr merged commit 3d9a887 into main May 27, 2026
24 checks passed
@TimoPtr TimoPtr deleted the feature/fail_fast_handler_instrumentation_tests branch May 27, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants