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

👷 don't print log messages twice in unit tests #2959

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

baseReporterDecorator implements a bunch of methods that display messages in the console. Since we already have a reporter for that, messages are displayed twice.

Changes

Remove baseReporterDecorator usage from our karma "skipped failed reporter" plugin. Without baseReporterDecorator, specSkipped and specFailure "hooks" don't exist anymore, so let's use onSpecComplete instead.

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

`baseReporterDecorator` implements a bunch of methods that display
messages in the console. Since we already have a reporter for that,
messages are displayed twice.

Without `baseReporterDecorator`, `specSkipped` and `specFailure` "hooks"
don't exist anymore, so let's use `onSpecComplete` instead.
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner August 30, 2024 09:59
@BenoitZugmeyer BenoitZugmeyer requested a review from nulrich August 30, 2024 09:59
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.41%. Comparing base (a164897) to head (350dd01).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2959      +/-   ##
==========================================
- Coverage   93.42%   93.41%   -0.02%     
==========================================
  Files         271      271              
  Lines        7637     7637              
  Branches     1704     1704              
==========================================
- Hits         7135     7134       -1     
- Misses        502      503       +1     

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

Copy link
Contributor

@N-Boutaib N-Boutaib left a comment

Choose a reason for hiding this comment

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

Thanks for this change, I was always wondering why two logs are printed 😅

Copy link

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 160.86 KiB 160.86 KiB 0 B 0.00%
Logs 55.98 KiB 55.98 KiB 0 B 0.00%
Rum Slim 109.47 KiB 109.47 KiB 0 B 0.00%
Worker 25.21 KiB 25.21 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.001 0.002 0.001
addaction 0.032 0.045 0.013
addtiming 0.001 0.001 0.001
adderror 0.033 0.066 0.033
startstopsessionreplayrecording 0.832 1.206 0.374
startview 1.017 1.119 0.102
logmessage 0.028 0.031 0.002
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 8.46 KiB 8.26 KiB -204 B
addaction 39.98 KiB 40.30 KiB 323 B
addtiming 7.73 KiB 7.83 KiB 101 B
adderror 45.16 KiB 45.09 KiB -73 B
startstopsessionreplayrecording 5.13 KiB 4.06 KiB -1100 B
startview 317.67 KiB 320.96 KiB 3.29 KiB
logmessage 40.11 KiB 40.44 KiB 335 B

🔗 RealWorld

@BenoitZugmeyer BenoitZugmeyer merged commit d3065fd into main Aug 30, 2024
20 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/dont-print-logs-twice-in-unit-tests branch August 30, 2024 13:29
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.

4 participants