-
Notifications
You must be signed in to change notification settings - Fork 477
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
Adapt to latest ddmlib version #210
Conversation
methodResult.markTestAsFailed(trace); | ||
} | ||
|
||
@Override public void testAssumptionFailure(TestIdentifier test, String trace) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assumption failure comes from JUnit 4. It means that the parameters in which the test was executing render the test irrelevant. It's much more like a programmatically determined ignore and should be treated as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example would be:
@Test public void bluetoothSomething() {
assumeThat(device.hasBluetooth());
assertTrue(somethingWithBluetooth());
}
You would get an assumption failure when the test was run on a device without bluetooth so the test isn't relevant for that device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But how can an assumption be made with Android's JUnit 3 runner?
Is there some new API that allows to write an Android test with an assumption or mark a test as ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's been a JUnit 4 runner in AOSP for about 6 months now. https://android.googlesource.com/platform/frameworks/testing/+/master/androidtestlib/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Well, actually for more than 2 years :)
Do you think this quick change can be accepted (currently ignoring assumption failures just like ignored tests)?
Another question is what has happened with what was called errors previously? Are they all failures now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was only made public recently, having been worked on internally for much longer.
Updated to ignore assumption failures. |
logDebug(debug, "assumption failure %s", trace); | ||
} | ||
|
||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this should be on the same line as the method
This change is a quick adaptation to changes in DDM lib used by Android Gradle plugin 0.14.x. Ignored tests and assumption failures are not represented in reports. Closes square#208.
Code style is fixed. |
Adapt to latest ddmlib version
Thanks! I'll get this pushed out tomorrow (Friday). |
This change is a quick adaptation to changes in DDM lib used by Android Gradle plugin 0.14.x.
Closes #208.
That said, I do not have a strong leg to stand on what assumption failure really means. However, it seems to correspond to
error
in previous versions.I didn't add ignored test handling since it requires additional changes in reports code.
I tested this with combination of spoon gradle plugin and Android plugin 0.14.1.