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: rename test_utils to utils_test to remove stretchr/testify dep #675

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

paralin
Copy link
Contributor

@paralin paralin commented Apr 10, 2024

I noticed that the pion-ice package had ~1MB of extra binary size due to the dependency on stretchr/testify.

Renaming test_utils.go to utils_test.go removes stretchr/testify from any non-test build and fixes this dependency. The tests still pass & the package still builds the same.

One can check the dependency graph with goda:

https://github.com/loov/goda

goda graph "reach(.:all, github.com/stretchr/testify/require)" | dot -Tsvg -o graph.svg

image

@Sean-Der
Copy link
Member

Nice catch! Do we have this problem anywhere else?

I will add this check to CI

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.15%. Comparing base (fd4b1f8) to head (4272dcf).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
- Coverage   79.25%   79.15%   -0.10%     
==========================================
  Files          42       41       -1     
  Lines        3789     3738      -51     
==========================================
- Hits         3003     2959      -44     
+ Misses        551      547       -4     
+ Partials      235      232       -3     
Flag Coverage Δ
go 79.15% <ø> (-0.10%) ⬇️
wasm 22.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@paralin
Copy link
Contributor Author

paralin commented Apr 10, 2024

After applying this PR I don't see any other reference to testify in my project's build which also imports the main webrtc packages. So, I think this is probably the only case where that happened.

I noticed that the pion-ice package had ~1MB of extra binary size due
to the dependency on stretchr/testify.

Renaming test_utils.go to utils_test.go removes stretchr/testify from
any non-test build and fixes this dependency. The tests still pass and
the package still builds the same.

One can check the dependency graph with goda:

https://github.com/loov/goda

goda graph "reach(.:all, github.com/stretchr/testify/require)" |\
    dot -Tsvg -o graph.svg

Signed-off-by: Christian Stewart <christian@aperture.us>
@Sean-Der Sean-Der merged commit 0860817 into pion:master Apr 10, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants