Navigation Menu

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

[tests] Avoid using adb install -r #429

Merged
merged 1 commit into from Feb 10, 2017

Conversation

jonpryor
Copy link
Member

@jonpryor jonpryor commented Feb 8, 2017

@xmcclure and I just spent hours trying to figure out why a
Xamarin.Android unit test was failing on her device, but nowhere else,
and -- further! -- how when she added new tests to the
Xamarin.Android.JcwGen_Tests package, the new tests and new debug
messages would never appear on adb logcat.

The result? An old install. Apparently,

adb install -r bin/TestDebug/Xamarin.Android.JcwGen_Tests-Signed.apk

wasn't actually installing updated file contents.

Manually uninstalling the Xamarin.Android.JcwGen_Tests package and
installing a new Xamarin.Android.JcwGen_Tests-Signed.apk resulted in
all tests passing, as expected.

What this means to me is that adb install -r can't be trusted.
We pulled our hair out for hours trying to figure out why various
things didn't appear to work at all, and nothing worked because we
were never getting the new app on her device.

(Insert fuming here.)

Consequently, avoid adb install -r. Instead, update the
$(RunApkTestsDependsOn) property so that we always call the
UndeployUnitTestApks target before calling the DeployUnitTestApks
target, and update the DeployUnitTestApks target to use "normal"
adb install instead of adb install -r.

@xmcclure and I just spent *hours* trying to figure out why a
Xamarin.Android unit test was failing on her device, but nowhere else,
and -- further! -- how when she added *new* tests to the
`Xamarin.Android.JcwGen_Tests` package, the new tests and new debug
messages would never appear on `adb logcat`.

The result? An old install. *Apparently*,

	adb install -r bin/TestDebug/Xamarin.Android.JcwGen_Tests-Signed.apk

wasn't actually installing updated file contents.

Manually uninstalling the `Xamarin.Android.JcwGen_Tests` package and
installing a new `Xamarin.Android.JcwGen_Tests-Signed.apk` resulted in
all tests passing, as expected.

What this means *to me* is that `adb install -r` *can't be trusted*.
We pulled our hair out *for hours* trying to figure out why various
things didn't appear to work at all, and nothing worked because we
were never getting the new app on her device.

(Insert fuming here.)

Consequently, *avoid* `adb install -r`. Instead, update the
`$(RunApkTestsDependsOn)` property so that we always call the
`UndeployUnitTestApks` target before calling the `DeployUnitTestApks`
target, and update the `DeployUnitTestApks` target to use "normal"
`adb install` instead of `adb install -r`.
@jonpryor jonpryor merged commit c37d219 into xamarin:master Feb 10, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants