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
Provide a way to run tests from a gem at install time #730
Comments
For example let's look at
The problem is that different gemfiles have different test, some of them have If gem creator was able to specify test_cmd then As of the second issue, gemspec already has |
RubyGems used to have this feature but it was removed due to the proliferation of ruby test tools. The large amount of tools and varying ways to run them causes a heavy maintenance burden on RubyGems, so I don't want to reintroduce this feature without the community coming up with some unified way of running tests. At the time of removal hooks were added to RubyGems to enable running tests at install time. See the rubygems-test gem for one example, but it currently is not being maintained. |
I see your points. In fact variety of test tool is the reason why I cannot run tests in my rubygems-pacman bridge (pacman - the package manager at Linux Arch). But I still think that having a way to test gemfile at the end-user machine would be useful. Like in my case with transparent bridge between two packaging systems. Or it can be useful for rubygems itself - when a user uploads gemfile, the server can run gem tests and reject those with broken tests. It case prevent you from situation when developers upload broken packages (e.g. forgot to add file to gemfile). One way to make 'gem test' more generic is to add new gemspec properties, e.g. Also gem should show a warning for gems that have "test_files" but do not have "test_cmd" In any case if you decide to add 'gem test' back sometime I'll be the first who will vote for this. |
I think in most cases you need all the development dependencies at install time for running the tests. also how do you want to handle things like "needs a running postgresql" for the testsuite. At openSUSE we just move the test files into a subpackage which is not installed by default. That way the files are available for the interested user. |
I work on a Rubygems-Arch bridge that adds tighter integration between ArchLinux system package manager and rubygems.
I see that many rubygems include tests. But I do not see how to run these tests. It would be great if rubygems had a flag (something like
gem install --runtests
) that will verify that gem works fine on this system.A related note - I think rubygems should not install test files on the system (at least by default). Test are needed only at build/install time. At run-time tests are useless for users.
The text was updated successfully, but these errors were encountered: