Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android Render Tests #10045

Closed
wants to merge 2 commits into from
Closed

Android Render Tests #10045

wants to merge 2 commits into from

Conversation

tobrun
Copy link
Member

@tobrun tobrun commented Sep 22, 2017

This PR adds an initial version of Android render testing using PixelMatch.

output

Execution of these tests on a armeabi-v7a compatible can be started with:

make run-android-render-test-arm-v7

This will result on generating images based on the test input file:

ezgif com-crop 5

After generating and pulling them from the device, we use PixelMatch to detect render differences:

pasted image at 2017_09_20 01_30 pm

The base set of expected images used can be found here and can be updated with:

make update-android-render-test

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Sep 22, 2017
@tobrun tobrun added this to the android-v5.2.0 milestone Sep 22, 2017
@tobrun tobrun self-assigned this Sep 22, 2017
Copy link
Contributor

@ivovandongen ivovandongen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

# pull generated images from the device
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox" platform/android/build/render-test
# copy expected result and run pixelmatch
python platform/android/scripts/run-render-test.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this depends on the pixelmatch node module being installed, should this target depend on $(BUILD_DEPS)? Or does it do that indirectly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how that was enforced, will look at integrating $(BUILD_DEPS)

# pull generated images from the device
adb pull "`adb shell 'printenv EXTERNAL_STORAGE' | tr -d '\r'`/mapbox" platform/android/build/render-test
# copy expected result and run pixelmatch
python platform/android/scripts/run-render-test.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any specific python dependencies?


import com.mapbox.mapboxsdk.testapp.activity.render.RenderTestActivity;

public class SnapshotterIdlingResource implements IdlingResource {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In c9c2e96 I'm taking a push approach which significantly speeds up the tests since it idles shorter before being ready. Might be beneficial here?

protected void onStop() {
super.onStop();
for (MapSnapshotter snapshotter : mapSnapshotterList) {
snapshotter.cancel();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be strictly needed anymore since the snapshotters are deletable by the gc collector thread now. Anything specific you run into?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do some additional tests, I remember hitting a freeze but could be fixed in meantime.

@tobrun tobrun mentioned this pull request Oct 10, 2017
@tobrun tobrun force-pushed the tvn-render-test-wip branch from 2477cc6 to 89e21d4 Compare October 27, 2017 20:49
@tobrun tobrun removed this from the android-v5.2.0 milestone Oct 30, 2017
@zugaldia zugaldia requested review from LukasPaczos and removed request for zugaldia December 23, 2017 17:47
@tobrun tobrun force-pushed the tvn-render-test-wip branch 2 times, most recently from 36607d1 to 9fd4aa3 Compare May 24, 2018 08:03
@tobrun tobrun force-pushed the tvn-render-test-wip branch from 9fd4aa3 to 1da8f0c Compare May 31, 2018 12:40
@tobrun tobrun mentioned this pull request May 31, 2018
8 tasks
@tobrun tobrun closed this Jun 6, 2018
@tobrun tobrun deleted the tvn-render-test-wip branch June 6, 2018 17:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants