Open kmadsen opened 3 years ago
As @Guardiola31337 found, we don't want to do this with a TestWatcher
. The reason is, because of the lifecycle scopes created by test runners. The testing utility class should explicitly save the file. That way we can call it before we handle MapboxNavigation.onDestory in the @After
test block
https://github.com/mapbox/mapbox-navigation-android/pull/4516#discussion_r653575232
@Guardiola31337 has a example of this working on a branch https://github.com/mapbox/mapbox-navigation-android/pull/4726
MapboxHistoryTestRule
will write history files to the /sdcard/Download/mapbox_test
device directory--directories-to-pull=/sdcard/Download/mapbox_test \
~In the instrumentation tests we could add a
MapboxHistoryTestRule
~ A TestWatcher creates lifecycle issues withMapboxNavigation
. Update to a test object,TestMapboxHistoryRecorder
.That test rule can save the history files from any test or benchmark. I think the file will need to be stored in external storage. That way we can move upload it to artifacts. Similar solution has been made for mobile-metrics.
Specifically looking to do this to help us solve this one https://github.com/mapbox/mapbox-navigation-android/pull/4419