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

Prevent logs from being outputed in our unit tests #1612

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Dec 23, 2024

Our unit tests had become noisy with deprecation notices and RxPlayer log outputs.

That noise doesn't play well with how those unit tests report as we generally configure them to have a compact output in the terminal (with the idea that a passing test is not useful information but a breaking test is).
Those added logs break that compact output into a unreadable mess of uninteresting warnings, which I find especially problematic for tests.

So here, I remove the 2 culprits for those logs:

  • deprecation notices from vitest have been handled by updating the tests (though I'm not sure of why they print deprecation logs each time when the same deprecated logic is encountered multiple times, one signal would have been enough and preferable IMO)

  • All logger unit tests mock console functions now

@peaBerberian peaBerberian added this to the 4.3.0 milestone Dec 23, 2024
@peaBerberian peaBerberian added the Priority: 3 (Low) This issue or PR has a low priority. label Dec 26, 2024
Our unit tests had become noisy with deprecation notices and RxPlayer
log outputs.

That noise doesn't play well with how those unit tests report as we
generally configure them to have a compact output in the terminal (with
the idea that a passing test is not useful information but a breaking
test is).
Those added logs break that compact output into a unreadable mess of
uninteresting warnings, which I find especially problematic for tests.

So here, I remove the 2 culprits for those logs:

  - deprecation notices from vitest have been handled by updating the
    tests (though I'm not sure of why they print deprecation logs each
    time when the same deprecated logic is encountered multiple times,
    one signal would have been enough and preferable IMO)

  - logs tests all mock `console` functions now
@peaBerberian peaBerberian force-pushed the misc/no-log-unit-tests branch from b9ee969 to 7038caa Compare January 28, 2025 14:04
Copy link

Automated performance checks have been performed on commit 7038caaebec2a5decd21ce763a21b1920af5b216 with the base branch dev.

Tests results

✅ Tests have passed.

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.24ms -> 20.04ms (-0.798ms, z: 1.94551) 26.55ms -> 26.70ms
seeking 14.62ms -> 14.69ms (-0.069ms, z: 1.02156) 11.25ms -> 11.25ms
audio-track-reload 25.66ms -> 25.63ms (0.027ms, z: 0.27794) 37.50ms -> 37.50ms
cold loading multithread 47.48ms -> 46.93ms (0.556ms, z: 11.54319) 69.45ms -> 68.40ms
seeking multithread 19.24ms -> 18.56ms (0.684ms, z: 0.39663) 10.35ms -> 10.35ms
audio-track-reload multithread 25.57ms -> 25.57ms (-0.002ms, z: 0.43881) 37.55ms -> 37.50ms
hot loading multithread 14.97ms -> 14.78ms (0.191ms, z: 5.30194) 21.60ms -> 21.45ms

If you want to skip performance checks for latter commits, add the skip-performance-checks label to this Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 3 (Low) This issue or PR has a low priority.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant