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

Improve code coverage metrics #3450

Merged
merged 39 commits into from
Sep 19, 2024
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 12, 2024

This PR is adding more tests on the :matrix:impl module.

Let's merge this PR, it's big enough and add more tests later.

Copy link
Contributor

github-actions bot commented Sep 12, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/HXHAtt

@bmarty bmarty added the PR-Misc For other changes label Sep 12, 2024
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.66%. Comparing base (d5ac6da) to head (2d9b0bb).
Report is 48 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3450      +/-   ##
===========================================
- Coverage    82.67%   82.66%   -0.01%     
===========================================
  Files         1731     1731              
  Lines        40841    40842       +1     
  Branches      4968     4968              
===========================================
  Hits         33764    33764              
  Misses        5315     5315              
- Partials      1762     1763       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty bmarty force-pushed the feature/bma/improveCoverageMetrics branch from 8f9a76c to 7fdd069 Compare September 12, 2024 18:45
@bmarty bmarty force-pushed the feature/bma/improveCoverageMetrics branch from 560d1b7 to e9a898f Compare September 18, 2024 16:08
@bmarty bmarty marked this pull request as ready for review September 18, 2024 16:54
@bmarty bmarty requested a review from a team as a code owner September 18, 2024 16:54
@bmarty bmarty requested review from jmartinesp and removed request for a team September 18, 2024 16:54
Copy link

sonarcloud bot commented Sep 18, 2024

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for this work!

Comment on lines +15 to +17
is RustClientException -> {
when (this) {
is RustClientException.Generic -> ClientException.Generic(msg)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use is RustClientException.Generic directly in the first branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not equivalent, using a dedicated when ensures that all the RustClientException sub-classes are mapped.

is ClientBuildException -> when (this) {
is ClientBuildException.Generic -> AuthenticationException.Generic(message)
is ClientBuildException.InvalidServerName -> AuthenticationException.InvalidServerName(message)
is ClientBuildException.SlidingSyncVersion -> AuthenticationException.SlidingSyncVersion(message)
Copy link
Member

Choose a reason for hiding this comment

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

I hope the Client builder retry wasn't affected by this! I think it uses the raw ClientBuildException.SlidingSyncVersion since it comes directly from the SDK.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it should be OK.

But just to understand, there is no code behavior change here, this is just about ensuring that all the ClientBuildException sub classes are mapped, or am I missing something?

Copy link
Member

Choose a reason for hiding this comment

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

No, it's fine. I double checked and we're using the exception from the SDK instead of the mapped one, so even if anything changed here it wouldn't matter.


class RoomPreviewMapperTest {
@Test
fun `map should map values 1`() {
Copy link
Member

Choose a reason for hiding this comment

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

Kind of a generic test name 😅 .

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I tried not to spend hours looking for perfect names for tests like this :)

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 19, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 19, 2024
@bmarty bmarty merged commit c510d12 into develop Sep 19, 2024
32 checks passed
@bmarty bmarty deleted the feature/bma/improveCoverageMetrics branch September 19, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants