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

Remove Bundler dependency from tests. #1213

Merged

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Feb 16, 2017

Hello,

Is it possible not to use "bundler/setup" in tests?

Because I am managing puma's RPM package in Fedora project.
https://admin.fedoraproject.org/pkgdb/package/rpms/rubygem-puma/

And we are running the puma unit tests without Bundler like this.
Though not using bundler is kind of our Fedora project's custom.

ruby \
  -r 'minitest/autorun' \
  -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' \
  -- -v

I know Bundler is useful for travis or local environment.
However I am happy that the tests do not depends on Bundler.

Thanks!

@nateberkopec
Copy link
Member

I'll let @schneems and @evanphx weigh in, but my gut reaction is this is a "no". Bundler is sort of the de facto in Ruby now, so I don't see any gain in removing it.

@evanphx
Copy link
Member

evanphx commented Feb 17, 2017

@junaruga Rather than remove it like this, I'd be happy to accept a patch that conditionalized requiring. Perhaps if ENV["NO_BUNDLER"] as the check.

@junaruga
Copy link
Contributor Author

@nateberkopec yeah I can understand your thoughts.
@evanphx ok I will send the patch! Thanks for the idea!

@junaruga junaruga force-pushed the feature/remove-bundler-dependency-from-tests branch from ab1a002 to 063c721 Compare February 18, 2017 14:54
@junaruga
Copy link
Contributor Author

@evanphx I update using begin - rescure instead of using environment variable.
It is easier for me not to use environment variable.
How?

@junaruga
Copy link
Contributor Author

As other possible solutions, I want to suggest if ENV["BUNDLER_VERSION"] and if defined?(Bundler).

$ bundle exec ruby -e 'puts ENV["BUNDLER_VERSION"] ? "True" : "False"'
True
$ ruby -e 'puts ENV["BUNDLER_VERSION"] ? "True" : "False"'
False
$ bundle exec ruby -e 'puts defined?(Bundler) ? "True" : "False"'
True

$ ruby -e 'puts defined?(Bundler) ? "True" : "False"'
False

@junaruga
Copy link
Contributor Author

On the Travis tests, only Ruby 2.3.3 failed with below Timeout::Error. However it is false positive isn't it?

TestThreadPool#test_trim_is_ignored_if_no_waiting_threads = /home/travis/build/puma/puma/lib/puma/thread_pool.rb:268:in `join': execution expired (Timeout::Error)

@evanphx evanphx merged commit b86d129 into puma:master Feb 28, 2017
@evanphx
Copy link
Member

evanphx commented Feb 28, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants