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

Fix so that builds won't pass when integration tests fail #41

Conversation

rtyley
Copy link
Contributor

@rtyley rtyley commented Jul 7, 2011

This fixes an issue with the new 3.0.0-alpha-1 build, where failing integration tests don't stop the build from succeeding. The old, correct behaviour (as of 2.9.0-beta-5) was that a failing integration test would cause the build to fail :)

3.0.0-alpha-1 uses ddmlib instead of the adb command for instrumentation, but the com.android.ddmlib.testrunner.RemoteAndroidTestRunner.run() method doesn't throw an exception when tests fail - instead it relies on the test listeners to report failures/errors to the user - so I've updated the AndroidTestRunListener to do just that, throwing a MojoFailureException and also reporting the number of failures/errors like old version used to do, ie:

FAILURES!!!
Tests run: 14, Failures: 0, Errors: 4

This was the old behaviour as of 2.9.0-beta-5 but a regression entered
with ecccb4a, when the mojo was upgraded to use ddmlib instead of the adb
command.

The com.android.ddmlib.testrunner.RemoteAndroidTestRunner.run()
doesn't throw an exception when tests fail, instead it relies on the test
listeners to report failures/errors to the user - so I've updated the
AndroidTestRunListener to do just that, throwing a MojoFailureException and
also reporting the number of failures/errors like old version used to do,
ie:

FAILURES!!!
Tests run: 14,  Failures: 0,  Errors: 4


http://android.git.kernel.org/?p=platform/sdk.git;a=blob;f=ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java;h=d680509ff0dc028e60f12cb9726f7dbb53b19965;hb=HEAD#l226

simpligility@ecccb4a#L0L117
hugojosefson added a commit that referenced this pull request Jul 7, 2011
…-integration-tests

Fix so that builds won't pass when integration tests fail
@hugojosefson hugojosefson merged commit a1a85b4 into simpligility:master Jul 7, 2011
@hugojosefson
Copy link
Contributor

Great feedback. :) Thanks!

@mosabua
Copy link
Member

mosabua commented Jul 7, 2011

Too funny. I never tested with failing tests so I did not notice ;-)

@rtyley
Copy link
Contributor Author

rtyley commented Jul 7, 2011

You gotta have failing tests, otherwise what would you fix? :-)

@mosabua
Copy link
Member

mosabua commented Jul 7, 2011

I know I just used it on already working projects and not in development..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants