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

Add unit tests setup #78

Merged
merged 9 commits into from
Oct 17, 2023
Merged

Add unit tests setup #78

merged 9 commits into from
Oct 17, 2023

Conversation

wzieba
Copy link
Collaborator

@wzieba wzieba commented Oct 12, 2023

Description

This PR adds unit tests setup for the SDK. I decided to introduce Robolectric to be able to test AsyncTask API.

It also adds support for measuring codecoverage via kover plugin, as well as integration with Codecov: https://app.codecov.io/github/Parsely/parsely-android

Kotlin Gradle Plugin is added as I plan to write tests in Kotlin and it was established internally, that we'll aim to rewrite the SDK to Kotlin as well.

To merge after #77 is merged

How to test

CI should be enough: you could also run koverHtmlReportRelease task and see generated HTML report with 0% code coverage.

Kover report

image

Because now project uses Kotlin Gradle Plugin, those constraints are no
longer needed.
Adding Robolectric to test AsyncTasks. To remove in the future.
@wzieba wzieba requested a review from ParaskP7 October 12, 2023 10:56
@wzieba wzieba marked this pull request as ready for review October 12, 2023 10:56
@wzieba wzieba removed the request for review from ParaskP7 October 12, 2023 10:59
@wzieba wzieba marked this pull request as draft October 12, 2023 10:59
@wzieba wzieba marked this pull request as ready for review October 12, 2023 11:12
@wzieba wzieba requested a review from ParaskP7 October 12, 2023 11:12
@ParaskP7 ParaskP7 self-assigned this Oct 13, 2023
Copy link
Collaborator

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @wzieba !

I have reviewed and tested this PR as per the instructions, everything works as expected, great job, let's start testing! 🌟 🎉 🌟


This PR adds unit tests setup for the SDK. I decided to introduce Robolectric to be able to test AsyncTask API.

👍

It also adds support for measuring codecoverage via kover plugin, as well as integration with Codecov: https://app.codecov.io/github/Parsely/parsely-android

Awesome, thanks for that and for trying kotlinx-kover! 🥇

Kotlin Gradle Plugin is added as I plan to write tests in Kotlin and it was established internally, that we'll aim to rewrite the SDK to Kotlin as well.

👍


I have left few suggestions (💡) for you to consider. I am going to approve this PR anyway, since none is blocking. I am NOT going to merge this PR yet to give you some time to apply any of my suggestions. However, feel free to ignore them and merge the PR yourself.


EXTRAS

  1. Minor (🔍): The testImplementation dependencies got added as part of this 915e4e8 commit. which was a bit off. I guess that was meant for that next a109e80 commit instead... 😅

parsely/build.gradle Outdated Show resolved Hide resolved
parsely/build.gradle Outdated Show resolved Hide resolved
parsely/build.gradle Outdated Show resolved Hide resolved
settings.gradle Show resolved Hide resolved
Base automatically changed from flush_events_on_app_on_stop to main October 16, 2023 11:02
@codecov
Copy link

codecov bot commented Oct 16, 2023

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@wzieba wzieba merged commit 8ec3720 into main Oct 17, 2023
1 check passed
@wzieba wzieba deleted the unit_tests_setup branch October 17, 2023 13:30
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.

None yet

2 participants