testing-samples icon indicating copy to clipboard operation
testing-samples copied to clipboard

Looking for working example of Sharding?

Open xCatG opened this issue 11 years ago • 3 comments

I am trying to use sharding with the new AndroidJUnitRunner, using the sample in testrunner/AndroidJunitRunnerSample in this repo.

$./gradlew installDebug installDebugAndroidTest
# normal instrumentation
$ adb shell am instrument -w  com.example.android.testing.androidjunitrunnersample.test/android.support.test.runner.AndroidJUnitRunner
# sharding
$ adb shell am instrument -w -e numShards 5 -e shardIndex 1  com.example.android.testing.androidjunitrunnersample.test/android.support.test.runner.AndroidJUnitRunner

However, the number of test run in both are 69 for me... Is there something I missed?

P.S. If I use $ adb shell am instrument -w -e numShards 5 -e shardIndex 10 it still runs all 69 tests without complaining. If I use $ adb shell am instrument -w -e numShards 5 -e shardIndex A it will actually throw NumberFormatException correctly, so I am sure the parameters are correctly being processed...

xCatG avatar Jun 27 '15 03:06 xCatG

Looks like a bug. I'll add a task and we will look into it. I keep this issue open to track progress on this.

slinzner avatar Jun 30 '15 12:06 slinzner

This was now fixed internally and will go out with the next release...

slinzner-corp avatar Aug 19 '15 16:08 slinzner-corp

Thanks!

xCatG avatar Aug 19 '15 17:08 xCatG