Rails dependencies tests size

Hello, first time here :slight_smile:

I was reading some things here and saw that some Rails dependencies comes with test folders that aren’t needed…

$ cd gem_path

$ find -type d ( -name “spec” -o -name “test” ) -maxdepth 2 -exec du -hs {} ;

2,4M	./racc-1.5.2/test
132K	./minitest-5.14.4/test
60K	    ./childprocess-3.0.0/spec
60K	    ./jbuilder-2.11.2/test
60K	    ./sassc-2.4.0/test
60K	    ./xpath-3.2.0/spec
36K	    ./rails-html-sanitizer-1.3.0/test
312K	./capybara-3.35.3/spec
20K	    ./rb-inotify-0.10.1/spec
24K	    ./method_source-1.0.0/spec
60K	    ./builder-3.2.4/test
72K	    ./webdrivers-4.6.0/spec
24K	    ./rails-dom-testing-2.0.3/test
392K	./regexp_parser-2.1.1/spec
116K	./public_suffix-4.0.6/test
268K	./addressable-2.7.0/spec
124K	./sqlite3-1.4.2/test
148K	./webpacker-5.2.1/test
20K	    ./rack-proxy-0.6.5/test
180K	./msgpack-1.4.2/spec
48K	    ./bindex-0.8.1/test
252K	./sassc-rails-2.1.2/test
76K	    ./nio4r-2.5.7/spec

Fixing these gemspec to ignore spec and test paths would save 5Mb (~3,7%) of total gems path (130Mb) in a new rails (v6.1.3.1) app. Also as bundler downloads the .gem file it would save ~2% in the install time as well (less ~610Kb). And it might save many gigabytes of rubygems bandwidth too :smiley:

I can try to do it, but I would like to know if its makes sense or if its missing something out… Thanks!

I believe tests do not need to ship with gems, Rails components don’t include them. However, that is the call of each gem author.