rubygems / gemstash

A RubyGems.org cache and private gem server
MIT License
754 stars 121 forks source link

Failing tests when ran locally. #227

Open duckinator opened 5 years ago

duckinator commented 5 years ago

I tried to get a working development environment for gemstash. I couldn't find any documentation on doing so, so I did my usual approach:

$ git clone https://github.com/bundler/gemstash.git
$ cd gemstash
$ bundle install
$ bundle exec rake spec

And bundle exec rake spec gave this output: https://gist.github.com/duckinator/0e9088d0f24281170b6dfb1518514d39

There appears to be two distinct errors.

The first is this, which I have also encountered with Bundler:

       ERROR:  While executing gem ... (NameError)
           uninitialized constant Gem::RDoc
     # ./spec/integration_spec.rb:204:in `block (4 levels) in <top (required)>'

The second is this one, which I find very strange because I'm... running it through bundler 2.0.1:

       /usr/local/share/ruby/site_ruby/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.1) required by `$BUNDLER_VERSION`. (Gem::GemNotFoundException)
       To update to the latest version installed on your system, run `bundle update --bundler`.
       To install the missing version, run `gem install bundler:2.0.1`
        from /usr/local/share/ruby/site_ruby/rubygems.rb:302:in `activate_bin_path'
        from /home/pup/.gem/ruby/bin/bundle:23:in `<main>'
     Shared Example Group: "a bundleable project" called from ./spec/integration_spec.rb:251

Any ideas where to start poking at this?

bronzdoc commented 5 years ago

Hi @duckinator

We have a Development section in the README i tried the instructions there to set up Gemstash and works well, i can't reproduce the errors you are getting, maybe this is a problem with your ruby environment and not a Gemstash issue?

duckinator commented 5 years ago

Hi, sorry for disappearing before.

I came up with a testcase. This will reproduce the errors about Bundler (plus a few others), then print "Bundler version 2.0.1":

docker run --rm -it fedora:29 /bin/bash -c "dnf install -y redhat-rpm-config ruby ruby-devel libffi libffi-devel git sqlite-devel @development-tools && git clone https://github.com/bundler/gemstash.git && cd gemstash && gem install bundler && ./bin/setup && bundle exec rake; bundle --version"

Whereas this has only 2 errors (unrelated to Bundler versions), then prints "Bundler version 1.17.2":

docker run --rm -it ruby:2.6-slim /bin/bash -c "apt update && apt install -y git libsqlite3-dev build-essential && git clone https://github.com/bundler/gemstash.git && cd gemstash && ./bin/setup && bundle exec rake; bundle --version"

Given the Bundler versions and the errors, that is the exact opposite behavior of what I'd expect.

olleolleolle commented 2 years ago

👋 Hi!

I did the steps indicated in the original post, now quite old, and I had to tell my shell to allow more file handles: I took this from the CI configuration, and then all the tests ran to completion, no failures.

ulimit -n 8192