Age | Commit message (Collapse) | Author | Files | Lines |
|
The `pip` provider will repeatedly install a package if the case does not match
what is in `pip freeze`.
|
|
The tests for pip alter the confines for the pip provider by stubbing the
underlying facter calls and then calling lazy_pip. This can leak into later
tests, causing weird failures.
|
|
Redhat' sytems
|
|
|
|
|
|
Without this patch we don't have an automated way to validate the
expectation that the pip package provider does not execute with the `-e`
flag present.
This patch makes this expectation explicit and automatically verifiable.
|
|
-e causes a few problems with puppet:
1. it tries to install to /root/src.
2. It makes the items editable, which isn't useful.
3. reapplying puppet will cause pip to re-install.
Removing -e should help.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
Apply a 10 second timeout to XMLRPC calls to PyPI and catch them, reporting an
error gracefully.
|
|
Without this patch the pip package provider does not produce a user
friendly error message when the pip command is not available. The
current error message looks like this:
err: /Stage[main]/Dummy/Package[virtualenv]/ensure: change from
absent to present failed: Could not set 'present on ensure:
undefined method `pip' for
#<Puppet::Type::Package::ProviderPip:0xb6cf6cd0> at
/etc/puppet/modules/dummy/manifests/init.pp:5
This patch improves the error message by passing a string argument, 'Could not locate
the pip command.', when raising the `NoMethodError`. The new error
message looks like this:
err: /Stage[main]/Dummy/Package[virtualenv]/ensure: change from
absent to present failed: Could not set 'present on ensure: Could
not locate the pip command. at
/etc/puppet/modules/dummy/manifests/init.pp:5
This patch also includes updated spec tests validating this change. No
other behavior changes are being introduced.
|
|
I noticed a test failure when I ran the specs without an internet
connection. Specs should never need an internet connection to pass.
Reviewed-by: Max Martin <max@puppetlabs.com>
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...
...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name. Yay.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
The testing of lazypip forgot to stub which, so they worked when pip was
installed, but didn't work when it wasn't. Appropriate stubbing has
been put in place, and stubs changed to expects for some stronger
assertions about what's happening.
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
Uninstall wasn't working properly because the instances method relied on
the pip command having been defined by calling lazy_pip. This lazy_pip
pattern is a nice way of getting around Puppet's problem of
disqualifying providers at the beginning of a run because the command
doesn't yet exist even though part way through the run the command might
exist.
Really, we need to fix puppet to lazily evaluate a provider
command for validity only at the time the provider is needed.
The refactoring also pointed out that query could just reuse the logic
from instances.
The tests were also refactored to use real resources instead of stubbed
ones, and they reflect the implementation changes to instances.
Paired-with: Richard Crowley <r@rcrowley.org>
|
|
Python's pip package manager is analogous to RubyGems and should be included in Puppet.
Reviewed-by: Matt Robinson <matt@puppetlabs.com>
|