resque / resque-web

a Rails-based web interface to Resque
235 stars 166 forks source link

removing test files from built gem #118

Closed jstenhouse closed 7 years ago

jstenhouse commented 8 years ago

I saw that resque-web is including all of the tests in the released gem - the test directory includes a lot of extra files that I don't think are needed at runtime, especially in the test/dummy directory. The test directory weighs in at 4.1Mb out of a total 4.3Mb gem (~95% of total size).

I'm using resque-web with docker and was looking for ways to slim down my image layers and an extra 4Mb across lots of gems really add up.

mcfiredrill commented 8 years ago

Ohhh nice 👍

mcfiredrill commented 8 years ago

Hmm I guess I'm not sure what the test_files method in .gemspec is really for then? Why would someone want to include the test files in their released gem in the first place? 🤔

jstenhouse commented 8 years ago

@mcfiredrill I think it was originally for when gem had a test command but it was removed way back when -- I think some gem developers like to include them so that an end user could run the test if they unpacked the gem but it doesn't make much sense to me since most clients just need the runtime source files and dependencies.

There's been an open issue with rubygems for a while to add an option to exclude test files at gem install time and there's some more discussion there on whether to include test files at all. For what it's worth, Resque doesn't include any tests in their gemspec either.

I tested my app pointing to this branch and resque-web worked fine with a plugin. It looks like a safe change. 👍

mcfiredrill commented 8 years ago

@jstenhouse Thanks for digging up those links! I'm 👍 on merging this, maybe @kirillplatonov wants to have a look...

mcfiredrill commented 7 years ago

@kirillplatonov just curious , you didn't want to merge this?

kirillplatonov commented 7 years ago

@mcfiredrill my bad, I thought it's already in master. Will merge now.