Skip to content

Commit 7117bf4

Browse files
committed
test(e2e, android): Java gives you path in /data/user/0, use it to pull device coverage file
it is apparently a symbolic link to /data/data per docs, but in practice after Java dumped the file there, adb could not see it. Java dumped it to /data/data locally but /data/user/0 in CI which was also odd Also sleep a moment to let the app quiet down and dump the report
1 parent 837f36c commit 7117bf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/e2e/init.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ after(async function () {
5656

5757
// emits 'cleanup' across socket, which goes native, terminates Detox test Looper
5858
// This returns control to the java code in our instrumented test, and then Instrumentation lifecycle finishes cleanly
59+
await Utils.sleep(5000); // give async processes (like Firestore writes) time to complete
5960
await detox.cleanup();
61+
await Utils.sleep(5000); // give client app time to dump coverage report
6062

6163
// Get the file off the device, into standard location for JaCoCo binary report
6264
// It will still need processing via gradle jacocoAndroidTestReport task for codecov, but it's available now
6365
if (isAndroid) {
6466
const pkg = 'com.invertase.testing';
65-
const emuOrig = `/data/data/${pkg}/files/coverage.ec`;
67+
const emuOrig = `/data/user/0/${pkg}/files/coverage.ec`;
6668
const emuDest = '/data/local/tmp/detox/coverage.ec';
6769
const localDestDir = './android/app/build/output/coverage/';
6870

0 commit comments

Comments
 (0)