Skip to content

RUM-1519 Api coverage#1681

Merged
xgouchet merged 5 commits into
developfrom
xgouchet/RUM-1519/api_coverage
Oct 27, 2023
Merged

RUM-1519 Api coverage#1681
xgouchet merged 5 commits into
developfrom
xgouchet/RUM-1519/api_coverage

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR attemps to get an "API coverage" for our integration tests suites:

  • Using Detekt (and it's type resolution feature), we can generate an apiSurface and apiUsage log files. The API Surface is generated from the public class/functions of the public libraries, and API Usage is generated from the test classes in the integration test suites
  • Using a script we can count the number of lines in API Surface also present in API Usage and get a coverage number
  • For now the coverage will be reported as a warning, but eventually it will become an error if not 100%

Motivation

As part of our updated test pyramid definition, we need to have a reliable coverage reporting for integration tests

@xgouchet
xgouchet force-pushed the xgouchet/RUM-1519/api_coverage branch 4 times, most recently from 09b2d03 to 00315ac Compare October 26, 2023 12:30
@xgouchet
xgouchet force-pushed the xgouchet/RUM-1519/api_coverage branch from 00315ac to f86af62 Compare October 26, 2023 13:11
@codecov-commenter

codecov-commenter commented Oct 26, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1681 (1ecd387) into develop (ad4d00a) will decrease coverage by 0.11%.
Report is 2 commits behind head on develop.
The diff coverage is 88.89%.

@@             Coverage Diff             @@
##           develop    #1681      +/-   ##
===========================================
- Coverage    83.66%   83.55%   -0.11%     
===========================================
  Files          462      462              
  Lines        15843    15855      +12     
  Branches      2363     2365       +2     
===========================================
- Hits         13254    13247       -7     
- Misses        1950     1968      +18     
- Partials       639      640       +1     
Files Coverage Δ
...al/persistence/file/batch/BatchFileOrchestrator.kt 93.67% <100.00%> (ø)
...ernal/instrumentation/gestures/GesturesListener.kt 92.36% <ø> (ø)
...droid/rum/tracking/FragmentViewTrackingStrategy.kt 83.93% <100.00%> (+4.30%) ⬆️
...droid/sessionreplay/material/TabWireframeMapper.kt 98.11% <100.00%> (+0.04%) ⬆️
...ssionreplay/internal/processor/MutationResolver.kt 89.27% <100.00%> (+0.05%) ⬆️
...internal/recorder/DefaultOptionSelectorDetector.kt 90.91% <100.00%> (+0.91%) ⬆️
...ssionreplay/internal/recorder/TreeViewTraversal.kt 100.00% <100.00%> (ø)
...ssionreplay/internal/recorder/ViewUtilsInternal.kt 100.00% <ø> (ø)
...rnal/recorder/obfuscator/rules/TextTypeResolver.kt 95.24% <ø> (ø)
...in/com/datadog/android/sqldelight/SqlDelightExt.kt 85.71% <ø> (ø)
... and 5 more

... and 21 files with indirect coverage changes

@xgouchet
xgouchet marked this pull request as ready for review October 27, 2023 07:19
@xgouchet
xgouchet requested a review from a team as a code owner October 27, 2023 07:19

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great work!

private fun freeSpaceIfNeeded() {
val files = listSortedBatchFiles()
val sizeOnDisk = files.sumOf { it.lengthSafe(internalLogger) }
val sizeOnDisk = files.sumOf { f: File -> f.lengthSafe(internalLogger) }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is explicit type needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it helped it resolving a type at some point

@xgouchet
xgouchet merged commit d8f8c22 into develop Oct 27, 2023
@xgouchet
xgouchet deleted the xgouchet/RUM-1519/api_coverage branch October 27, 2023 08:55
@xgouchet xgouchet added this to the 2.3.0 milestone Dec 13, 2023
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.

3 participants