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

refactor: api mocks [WPB-9999] #3053

Merged
merged 7 commits into from
Oct 8, 2024
Merged

refactor: api mocks [WPB-9999] #3053

merged 7 commits into from
Oct 8, 2024

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented Oct 8, 2024

SpikeWPB-9999 [Android] Investigate the text message event handling bottleneck and spickes


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

  • refactored mocks to be more connected with each other
  • used serializer to easier create mocks
  • added integration givenUserWhenHandlingTextMessagesThenProcessShouldSucceed test to measure text messages handling time
  • added TimeLogger for measuring time in tests

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

run givenUserWhenHandlingTextMessagesThenProcessShouldSucceed() test

@Garzas Garzas self-assigned this Oct 8, 2024
@echoes-hq echoes-hq bot added the echoes: technical-roadmap Work contributing to the Technical Roadmap, to improve our velocity or reduce the technical debt. label Oct 8, 2024
Copy link
Contributor

github-actions bot commented Oct 8, 2024

Test Results

3 213 tests  +1   3 107 ✅ +1   4m 22s ⏱️ +12s
  551 suites ±0     106 💤 ±0 
  551 files   ±0       0 ❌ ±0 

Results for commit 3829f13. ± Comparison against base commit 8b65be7.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Oct 8, 2024

🐰 Bencher Report

Branchrefactor/api-mocks
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
709,026.75
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
601,840,275.70
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
951,273,411.73
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,646,551.68
🐰 View full continuous benchmarking report in Bencher

@datadog-wireapp
Copy link

datadog-wireapp bot commented Oct 8, 2024

Datadog Report

Branch report: refactor/api-mocks
Commit report: de15070
Test service: kalium-jvm

✅ 0 Failed, 3107 Passed, 106 Skipped, 20.01s Total Time

Copy link

sonarqubecloud bot commented Oct 8, 2024

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0.44053% with 226 lines in your changes missing coverage. Please review.

Project coverage is 52.41%. Comparing base (8b65be7) to head (3829f13).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...e/kalium/mocks/mocks/connection/ConnectionMocks.kt 0.00% 60 Missing ⚠️
...lium/mocks/mocks/conversation/ConversationMocks.kt 0.00% 32 Missing ⚠️
...n/com/wire/kalium/mocks/requests/PreKeyRequests.kt 0.00% 31 Missing ⚠️
...tlin/com/wire/kalium/mocks/mocks/user/UserMocks.kt 0.00% 23 Missing ⚠️
...wire/kalium/mocks/requests/ConversationRequests.kt 0.00% 23 Missing ⚠️
.../com/wire/kalium/mocks/mocks/client/ClientMocks.kt 0.00% 11 Missing ⚠️
...m/wire/kalium/mocks/requests/ConnectionRequests.kt 0.00% 9 Missing ⚠️
...in/kotlin/com/wire/kalium/logic/util/TimeLogger.kt 0.00% 8 Missing ⚠️
.../mocks/responses/NotificationEventsResponseJson.kt 0.00% 8 Missing ⚠️
...wire/kalium/mocks/requests/NotificationRequests.kt 0.00% 7 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3053      +/-   ##
===========================================
- Coverage    52.50%   52.41%   -0.10%     
===========================================
  Files         1304     1307       +3     
  Lines        50178    50274      +96     
  Branches      4679     4666      -13     
===========================================
+ Hits         26348    26349       +1     
- Misses       21943    22039      +96     
+ Partials      1887     1886       -1     
Files with missing lines Coverage Δ
...essage/confirmation/ConfirmationDeliveryHandler.kt 87.80% <100.00%> (ø)
...com/wire/kalium/mocks/responses/CommonResponses.kt 0.00% <0.00%> (ø)
...responses/conversation/ConversationResponseJson.kt 0.00% <0.00%> (ø)
...e/kalium/network/utils/MockUnboundNetworkClient.kt 0.00% <0.00%> (ø)
...n/com/wire/kalium/mocks/mocks/client/TokenMocks.kt 0.00% <0.00%> (ø)
...in/com/wire/kalium/mocks/mocks/asset/AssetMocks.kt 0.00% <0.00%> (ø)
...wire/kalium/mocks/requests/NotificationRequests.kt 0.00% <0.00%> (ø)
...in/kotlin/com/wire/kalium/logic/util/TimeLogger.kt 0.00% <0.00%> (ø)
.../mocks/responses/NotificationEventsResponseJson.kt 0.00% <0.00%> (ø)
...m/wire/kalium/mocks/requests/ConnectionRequests.kt 0.00% <0.00%> (ø)
... and 6 more

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b65be7...3829f13. Read the comment docs.

@Garzas Garzas added this pull request to the merge queue Oct 8, 2024
Merged via the queue into develop with commit 8be3015 Oct 8, 2024
22 checks passed
@Garzas Garzas deleted the refactor/api-mocks branch October 8, 2024 11:52
MohamadJaara pushed a commit that referenced this pull request Oct 18, 2024
* refactor: api mocks

* removed unnecessary conversation creation in test

* fix: hide conversation name in logs

* added documentation to logger

* test fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: technical-roadmap Work contributing to the Technical Roadmap, to improve our velocity or reduce the technical debt. 🚨 Potential breaking changes 👕 size: XXL type: refactoring 🛠
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants