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

Documentation about 'test_files' is confusing #90

Closed
emilsoman opened this issue Jul 16, 2014 · 2 comments
Closed

Documentation about 'test_files' is confusing #90

emilsoman opened this issue Jul 16, 2014 · 2 comments

Comments

@emilsoman
Copy link

@emilsoman emilsoman commented Jul 16, 2014

According to the section in the guides that talks about test_files gemspec attribute, test_files is a collection of unit test file which will be loaded as unit tests when the user requests a gem to be unit tested. How does the user request a gem to be unit tested ? Looks like --test option was removed from the gem command. So how is this test_files gemspec attribute useful currently ?

@drbrain drbrain closed this in c07356a Jul 16, 2014
@drbrain
Copy link
Member

@drbrain drbrain commented Jul 16, 2014

I removed them since they're no longer useful or recommended to set. This will be updated with the next release of RubyGems.

@bf4
Copy link
Contributor

@bf4 bf4 commented Jul 25, 2014

Perl still runs tests by default when installing cpan modules.. for some reason that never took off in the rubygems world.

epistrephein added a commit to epistrephein/rarbg that referenced this issue Jan 16, 2020
- Remove test_files attribute since it's deprecated and no longer used.
rubygems/guides#90 (comment)
- Use Dir[] instead of git ls-files to specify gem files, in order to improve readability and exclude unnecessary files.
- Don't include development files and RSpec tests in the built gem.
pocke added a commit to pocke/graphiql-rails that referenced this issue Sep 25, 2020
`Gem::Specification#test_files=` is no longer recommended.
rubygems/guides#90

And it increases gem package size because the option adds test files to
the package.

So I think we should avoid using `test_files=` option.

---

It reduces 4.7MB package size on my local.

before

```bash
$ du graphiql-rails-1.7.0/ --summarize
6.7M    graphiql-rails-1.7.0/
```

after

```bash
$ du graphiql-rails-1.7.0/ --summarize
2.0M    graphiql-rails-1.7.0/
```
cben added a commit to cben/kubeclient that referenced this issue May 11, 2021
test_files is deprecated.  It was causing all tests to
be shipped in the .gem file, which is useless bloat:
rubygems/guides#90
cben added a commit to cben/kubeclient that referenced this issue May 11, 2021
test_files is deprecated.  It was causing all tests to
be shipped in the .gem file, which is useless bloat:
rubygems/guides#90
cben added a commit to cben/kubeclient that referenced this issue May 11, 2021
test_files is deprecated.  It was causing all tests to
be shipped in the .gem file, which is useless bloat:
rubygems/guides#90

kubeclient-4.9.1.gem was 78 848 bytes, now down to 33 792.
cben added a commit to cben/kubeclient that referenced this issue May 11, 2021
test_files is deprecated.  It was causing all tests to
be shipped in the .gem file, which is useless bloat:
rubygems/guides#90

Compressed kubeclient-4.9.1.gem was 78KB, now down to 33KB.
Unpacked size 757KB -> 184KB.
cben added a commit to cben/kubeclient that referenced this issue May 11, 2021
test_files is deprecated.  It was causing all tests to
be shipped in the .gem file, which is useless bloat:
rubygems/guides#90

Compressed kubeclient-4.9.1.gem was 78KB, now down to 33KB.
Unpacked size 757KB -> 184KB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants