square / burst

A unit testing library for varying test data.
Apache License 2.0
464 stars 29 forks source link

Robolectric 2.3 support without any Robolectric modifications #32

Closed jacobtabak closed 9 years ago

jacobtabak commented 10 years ago

This branch pulls up all the private logic from RobolectricTestRunner into BurstRobolectricRunner. Unfortunately, it's only compatible with Robolectric 2.3 right now, but with some minor changes to Robolectric (next major version) we could easily remove most of the logic from BurstRobolectricRunner.

JakeWharton commented 10 years ago

This isn't as terrible as I expected. We need to push whatever changes are needed into Robolectric ASAP since I think a release is coming soon.

jacobtabak commented 10 years ago

How to fix this? I don't see a dependency on the support lib anywhere.

[ERROR] Failed to execute goal on project burst-robolectric: Could not resolve dependencies for project com.squareup.burst:burst-robolectric:jar:1.0.1-SNAPSHOT: Could not find artifact com.android.support:support-v4:jar:19.0.1 in central

JakeWharton commented 10 years ago

Ugh, it's transitive from Robolectric. Gross.

jacobtabak commented 10 years ago

Oh I see now.

Robolectric requires the Google APIs for Android (specifically, the maps JAR) and Android support-v4 library

JakeWharton commented 10 years ago

What happens if you add an <exclude> for those transitive deps?

jacobtabak commented 10 years ago

I imagine CI would fail, but can try. Is this the right solution? https://github.com/mosabua/maven-android-sdk-deployer

JakeWharton commented 10 years ago

It's the right solution to fix Robolectric building, but we can't and won't force that on this project.

jacobtabak commented 10 years ago

(CI running) I've never used it before, it's messy? Can it be isolated to this one module?

jacobtabak commented 10 years ago

No luck. Reverting that for now. Any way forward?

jacobtabak commented 10 years ago

Is this a dealbreaker or is it still worth pursuing the changes to robolectric test runner to make it extensible without the duplicated code?

JakeWharton commented 10 years ago

It's still worth pursuing upstream. We can figure out a way to resolve the build here separately.

dlubarov commented 9 years ago

Closing since this is old, but feel free to reopen it if you still want to pursue this.