Skip to content

Conversation

@williscool
Copy link
Owner

@williscool williscool commented Apr 22, 2025

HUGE intermittent build failure fix!

What Was the Problem?

Some Android instrumentation tests were intermittently failing with a NullPointerException (NPE) when the system tried to access Resources.getConfiguration() on a mocked Context. This happened because the mock context returned a real Resources object, but the underlying Configuration was null in the test environment. This caused failures during test setup or when Android tried to bind the application context.

this was causing reporting to break (as it caused the app would crash and break the xml listener )

Why Did This Happen?

  • The test code used every { getResources() } returns realContext.resources to delegate resource calls to the real context.
  • In the test environment, the real Resources object sometimes had a null Configuration property, which is not expected in production.
  • When Android or the app code called getConfiguration() on this Resources object, it triggered an NPE.

How Was It Fixed?

  • Instead of delegating to the real context's resources, we created a proper mock Resources object using MockK.
  • This mock always returns a valid, non-null Configuration object:

will add more docs about it to next pr but this is blocking all builds so just going to merge now.

also

  • scripts/prep_for_windows_build.sh to fix window build issues
  • feat: co pilot instructions
  • feat: dorny actions summary
  • fix: build time at start
  • fix: fix
  • ci: maybe fix coverage reports
  • ci: maybe fix jacoco actions report error

@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

github-actions bot commented Apr 22, 2025

Code Coverage Report

Overall Project 13.21%

There is no coverage information present for the Files changed

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.79
Changed Files 100

View detailed coverage report

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 1.46
Changed Files 100

View detailed coverage report

1 similar comment
@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 1.46
Changed Files 100

View detailed coverage report

@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 14.07
Changed Files 100

View detailed coverage report

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.37
Changed Files 100

View detailed coverage report

@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.73
Changed Files 100

View detailed coverage report

@williscool williscool force-pushed the ci/fix_test_reporting_maybe_other_nicetys branch from d6946ad to 9534179 Compare April 23, 2025 02:53
@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.81
Changed Files 100

View detailed coverage report

@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

for now just deletes problematic node_modules files

but could be used for whatever makes the build work on windows
@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.73
Changed Files 100

View detailed coverage report

…ion line

execution 'ANDROIDX_TEST_ORCHESTRATOR'

weird that it only broke cAT but not the instrument runner
@github-actions
Copy link

Build artifacts for this PR are available:

You can download these artifacts from the "Artifacts" section of the workflow run.

@github-actions
Copy link

📊 Code Coverage Summary

Coverage Type Coverage
Overall 13.21
Changed Files 100

View detailed coverage report

@williscool williscool changed the title ci/fix test reporting maybe other nicetys ci: fix intermittent build failures and some other things Apr 23, 2025
@williscool williscool merged commit 611bc3a into master Apr 23, 2025
10 checks passed
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