Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Coveralls Integration #101

Merged
merged 18 commits into from
Jul 5, 2017
Merged

Coveralls Integration #101

merged 18 commits into from
Jul 5, 2017

Conversation

bobheadxi
Copy link
Collaborator

@bobheadxi bobheadxi commented Jul 1, 2017

Issues

#59 and #58, mostly because I just did it for one of my repos and it looks kind of neat

Changes

  • Travis now runs androidConnectedTest and generates a coverage report with Coveralls
  • Adds Coveralls badge to README with code coverage percentage

@bobheadxi
Copy link
Collaborator Author

bobheadxi commented Jul 1, 2017

Lol 44 minute Travis build, hopefully it doesn't take this long every time? I ran into some examples while trying to get this up and running that mentioned having Travis cache various Gradle files to speed up builds - would that be a good thing to add here @d4rken ?

Also I realise that the coverage reports are not being uploaded to Coveralls properly, I am looking into it

.travis.yml Outdated
script:
- ./gradlew clean assemble test
- ./gradlew clean assemble connectedAndroidTest coveralls
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connectedAndroidTest runs instrumentation tests, and test runs junit tests, I think just using either means it's not running the other.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would ./gradlew clean assemble test connectedAndroidTest coveralls work?

app/build.gradle Outdated
@@ -49,6 +50,7 @@ android {
debug {
minifyEnabled false
useProguard false
testCoverageEnabled true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? Isn't this forced by coveralls in the test command? We don't need coveralls when developing, e.g. everytime we press RUN.

Copy link
Collaborator Author

@bobheadxi bobheadxi Jul 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is needed to generate the reports, running ./gradlew coveralls with that option disabled doesn't seem to make a report in .../build/reports/coverage, perhaps there's a way to toggle this based on whether or not it's in a CI environment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm mistaken and just setting this to "true" does not increase build times?

perhaps there's a way to toggle this based on whether or not it's in a CI environment

You can set env variables and check them from gradle, see https://docs.travis-ci.com/user/environment-variables/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm not sure, but I'll make it CI only before I finish up this pull request

.travis.yml Outdated

env:
matrix:
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go all out, how would we make it run the tests on both the lowest supported API, and the highest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add to the next commit :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a bit of trouble getting this working, but coveralls seems to be uploading correctly now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then lets make it for one API only, merge it and then try multiple APIs in a different PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just leaving it at just 21 because 22, 23, 24, 25 don't seem to work, will open up an issue to look into this further down the line

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0bc926c on bobheadxi:coverage-report into ** on d4rken:dev**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 4beac94 on bobheadxi:coverage-report into ** on d4rken:dev**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 25d7cc1 on bobheadxi:coverage-report into ** on d4rken:dev**.

@d4rken
Copy link
Member

d4rken commented Jul 5, 2017

Travis can be quite annoying ;).

@d4rken
Copy link
Member

d4rken commented Jul 5, 2017

@bobheadxi You can merge this, but use "Squash and merge", so the fix attempts are not part of the repos commit log.

@bobheadxi bobheadxi merged commit 6996d5e into d4rken-org:dev Jul 5, 2017
@bobheadxi
Copy link
Collaborator Author

Thanks! Glorious code coverage of less than 1% now proudly on display

@bobheadxi bobheadxi deleted the coverage-report branch July 5, 2017 18:20
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

3 participants