Skip to content

Commit 834b174

Browse files
TomTascheclaude
andcommitted
Add debugging for password test CI failure
- Add file size assertion to verify correct file is loaded - Log all test files in map for debugging - Add test lifecycle logging - Ensure activity is properly finished between tests These changes help investigate why the password-protected ODT causes a native crash on CI but works locally. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 16de141 commit 834b174

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

app/src/androidTest/java/at/tomtasche/reader/test/MainActivityTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,23 @@ public void setUp() {
7676
mainActivity.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
7777

7878
Intents.init();
79+
80+
// Log test setup for debugging
81+
Log.d("MainActivityTests", "setUp() called for test: " + getClass().getName());
7982
}
8083

8184
@After
8285
public void tearDown() {
86+
Log.d("MainActivityTests", "tearDown() called");
87+
8388
Intents.release();
8489

8590
if (null != m_idlingResource) {
8691
IdlingRegistry.getInstance().unregister(m_idlingResource);
8792
}
93+
94+
// Ensure activity is finished to reset state between tests
95+
mainActivityActivityTestRule.getActivity().finish();
8896
}
8997

9098
private static void copy(InputStream src, File dst) throws IOException {
@@ -203,6 +211,10 @@ public void testPasswordProtectedODT() {
203211
// Log file info for debugging CI issues
204212
Log.d("MainActivityTests", "Password test file path: " + testFile.getAbsolutePath());
205213
Log.d("MainActivityTests", "Password test file size: " + testFile.length());
214+
Log.d("MainActivityTests", "All test files: " + s_testFiles.keySet());
215+
216+
// Double-check we're using the right file
217+
Assert.assertEquals("password-test.odt file size mismatch", 12671L, testFile.length());
206218

207219
Context appCtx = InstrumentationRegistry.getInstrumentation().getTargetContext();
208220
Uri testFileUri = FileProvider.getUriForFile(appCtx, appCtx.getPackageName() + ".provider", testFile);

0 commit comments

Comments
 (0)