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

removing test files from built gem #118

Merged
merged 1 commit into from
Apr 25, 2017

Conversation

jstenhouse
Copy link

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
Copy link

Ohhh nice 👍

@mcfiredrill
Copy link

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
Copy link
Author

jstenhouse commented Sep 5, 2016

@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
Copy link

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

mcfiredrill added a commit to vcr/vcr that referenced this pull request Sep 6, 2016
I got the idea when we got a similar pull request on resque-web.
resque/resque-web#118

End users shouldn't need the test files and they take up space on disk.

The `test_files` method is left over from when `gem test` was a thing.
rubygems/rubygems@429f883

There is some more discussion on this in a rubygems issue:
rubygems/rubygems#735
@mcfiredrill
Copy link

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

@kirillplatonov
Copy link
Collaborator

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

@kirillplatonov kirillplatonov merged commit 271b8ef into resque:master Apr 25, 2017
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.

3 participants