Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSync configuration not pulling required files from the device to the report directory #548

Closed
nareshiot opened this issue Aug 25, 2021 · 7 comments · Fixed by #549
Closed

Comments

@nareshiot
Copy link

nareshiot commented Aug 25, 2021

Marathon 0.6.2
Java 11

With FileSyncConfiguration i'm unable to pull the screenshots from the External Storage directory. I couldn't find the screenshots from the device in index.html report.

image

This is how i have set the configuration in build.gradle.kts
pull.add(
com.malinskiy.marathon.android.configuration.FileSyncEntry(
"/screenshots/",
com.malinskiy.marathon.android.configuration.AggregationMode.TEST_RUN
)
)

@Malinskiy
Copy link
Member

Hi @nareshiot, thanks for taking the time to submit the issue.

Could you please attach relevant sections of execution log?
Also could you please check what's on the device at the relevant path, as in do you have any files at $EXTERNAL_STORAGE/screenshots/ on the emulator 5554?

Regarding the report - the files will end up in the reports device-files folder. They will not be part of any report that marathon generates

@nareshiot
Copy link
Author

Hi @Malinskiy Thanks for the quick response. I'm unable to locate logs related to fileSync. I also do not see a device-files folder under the build artifacts marathon/reports.
I do see the screenshots at this path: /storage/emulated/0/screenshots/ClassName/MethodName/test.png

Here's what I've done so far:

  • I take a screenshot at the end of my Espresso test and store it in the device path:
    /storage/emulated/0/screenshots/ClassName/MethodName/test.png
  • I've added the fileSyncConfiguration under the configure<com.malinskiy.marathon.MarathonExtension>() section
     pull.add(
com.malinskiy.marathon.android.configuration.FileSyncEntry(
"/screenshots/",  com.malinskiy.marathon.android.configuration.AggregationMode.TEST_RUN)
)
  • After the test run, I expect the screenshot taken to be present in a sub-folder under
    build/reports/device-files/screenshots/ClassName/MethodName/test.png

Am i missing something here?

@Malinskiy
Copy link
Member

If there is nothing to be pulled - the device-files folder will not be created.
To understand what's happening I need your log files from the test execution or at least the warnings/errors you have related to fileSync.

For example, when running with debug = true you should see something like:

...
... Pulling into /home/user/project/screenshots/
...

@nareshiot
Copy link
Author

While running in debug mode, i could only find listeners related to ScreenCapture and DebugTestRun, not seeing anything related to fileSync.

2021-08-25T23:09:59.297-0400 [WARN] [ScreenCapturerTestRunListener] Finished recording for ClassName.testName 2021-08-25T23:09:59.482-0400 [WARN] [DebugTestRunListener] testEnded emulator-5554 test = TestIdentifier(className=classname, testName=testName) 2021-08-25T23:09:59.482-0400 [QUIET] [system.out] 100% | [27]-[emulator-5554] classnames#testName ended 2021-08-25T23:10:00.065-0400 [WARN] [DebugTestRunListener] testRunEnded elapsedTime 34321 2021-08-25T23:10:00.122-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Execute runMarathon for :app:marathonDebugAndroidTest' 2021-08-25T23:10:00.124-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot outputs after executing task ':app:marathonDebugAndroidTest'' started 2021-08-25T23:10:00.125-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Snapshot outputs after executing task ':app:marathonDebugAndroidTest'' 2021-08-25T23:09:01.066-0400 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 2021-08-25T23:09:01.066-0400 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:marathonDebugAndroidTest 2021-08-25T23:10:00.066-0400 [WARN] [QueueActor[DevicePoolId(name=27)]] handle test results emulator-5554 2021-08-25T23:10:00.066-0400 [WARN] [QueueActor[DevicePoolId(name=27)]] request next batch for device emulator-5554 2021-08-25T23:10:00.067-0400 [WARN] [DevicePool[27]_DeviceActor[emulator-5554]] terminate emulator-5554 2021-08-25T23:10:00.110-0400 [QUIET] [system.out] Allure environment data saved. 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] Marathon run finished: 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] Device pool 27: 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] 1 passed, 0 failed, 0 ignored tests 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] Flakiness overhead: 0ms 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] Raw: 1 passed, 0 failed, 0 ignored, 0 incomplete tests 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] Total time: 0H 1m 14s 2021-08-25T23:10:00.121-0400 [QUIET] [system.out] 2021-08-25T23:10:00.122-0400 [WARN] [com.malinskiy.marathon.exceptions.BugsnagExceptionsReporter] Finish BugSnag

@Malinskiy
Copy link
Member

@nareshiot I've merged the fix for this problem into the develop branch now, should be part of the next release. Feel free to reopen the issue if it doesn't solve your problem

@nareshiot
Copy link
Author

@Malinskiy Thanks for fixing the issue. Could you please tell me when can we expect the next release.

@Malinskiy
Copy link
Member

@nareshiot this week is highly likely

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 a pull request may close this issue.

2 participants