-
Notifications
You must be signed in to change notification settings - Fork 3
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
Backend test coverage report #1616
Conversation
ebe08e5
to
69bd989
Compare
69bd989
to
a222e99
Compare
1075391
to
717e32f
Compare
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.
Thanks for bringing up this topic and creating a solution.
The tests did not work for me locally, as there where failing tests. I am on current branch and ran the tests with the ./gradlew koverLog koverHtmlReport
command. Are there any additional steps needed before?
> Task :test
app.ehrenamtskarte.backend.auth.service.AuthorizerTest > classMethod FAILED
java.lang.IllegalStateException at DockerClientProviderStrategy.java:277
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
app.ehrenamtskarte.backend.cards.CreateCardFromSelfServiceTest > classMethod FAILED
java.lang.IllegalStateException at DockerClientProviderStrategy.java:232
app.ehrenamtskarte.backend.userdata.UserImportTest > classMethod FAILED
java.lang.IllegalStateException at DockerClientProviderStrategy.java:232
45 tests completed, 3 failed
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/steffi/Dokumente/entitlementcard/backend/build/reports/tests/test/index.html
some other toughts:
- we have this codescene integreation ticket, that is releated: Add codescene PR integreation #1356
- i do not really mind the cluttering in the artifacts tab, as in the check backend step there are no other artifacts we want to find
- i would love to get an automatic message to the PR getting information on how many of the changed lines are covered by tests, or how the changes of the PR increased/decreased the test coverage. With only the changes you suggested, i think we will rarely look at this.
@ztefanie I have an assumption that the tests are not working for you locally on the main branch either. Could you please check? |
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.
works as expected on macos, nice!
@ztefanie actually I do look into the report when I add tests. maybe then I remove it from CI for now until we implement a nice representation with an automatic message etc using codescene? |
As you already implemented it, I would prefer not to remove it. Maybe an issue with a follow up task of bringing the results of the testing back to github is enough? |
@ztefanie @seluianova |
I have created a follow-up task #1682 |
# Conflicts: # backend/src/main/kotlin/app/ehrenamtskarte/backend/cards/Argon2IdHasher.kt # docs/CreateKoblenzHash.md
Short description
I suggest applying the kover plugin to be able to build test coverage reports in the backend.
It allows you to see the test coverage per line of code like this:
Side effects
This creates a bit of clutter in the circle ci artifacts.
Alternatives to the clutter would be:
Testing
./gradlew koverHtmlReport
or
Resolved issues
n/a
Additional info
Our current test coverage is 31.4741% (per line)