summaryrefslogtreecommitdiff
path: root/spec/unit/module_tool/applications/installer_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-04-17(PUP-2093) Improve documentation and test names.Pieter van de Bruggen1-15/+16
Prior to this commit, there were a number of places where documentation was missing and test names were insufficiently descriptive. This commit adds additional clarity around those places, and makes a couple of code clarity changes as well.
2014-04-04(PUP-2093) Migrate PMT to /v3 API.Pieter van de Bruggen1-261/+292
Prior to this commit, the PMT managed all communication with the Forge via the (now legacy) /v1 API. That API has been deprecated (primarily due to scalability concerns), which is less of an issue since it was never officially a public API. This commit migrates all communication to the Forge to the new /v3 API, which is expected to be launched as our official public API "soon". This commit also integrates a standalone dependency resolver, as the /v3 API contains no implicit dependency resolution (as the /v1 API did); consequently, large portions of the PMT code have been changed, and others have become unreachable. This commit also changes the default host that the PMT communicates with, from https://forge.puppetlabs.com to https://forgeapi.puppetlabs.com (the natural URL for the Forge API service). Since the tool now expects to communicate with a completely different service, it will be unable to communicate with services that do not implement the same /v3 API.
2014-03-07Merge branch 'pr/2322'Josh Cooper1-0/+31
* pr/2322: (PUP-1563) Don't recurse when dependencies are empty (PUP-1563) resolve_install_conflicts excessively recurses Closes GH-2322
2014-03-07(PUP-1563) Don't recurse when dependencies are emptyJosh Cooper1-0/+31
Previously we would recurse for each leaf dependency unnecessarily. This commit ensures we only recurse if we have a non-empty set of dependencies, and adds a debug message when conflicts are checked. It also adds a spec tests to ensure we evaluate each module for conflicts only once. Paired-with: Josh Partlow <joshua.partlow@puppetlabs.com>
2014-02-18(PUP-1584) module_tool uses current_environment with target_dir overridesJosh Partlow1-15/+10
The module tool was relying on the implicit creation and caching of legacy environments based on puppet settings for environment and modulepath. But this does not work for the new directory style of environments. So we are being explicit about using the current environment from the context, and overriding modulepath to prepend a target_dir if given, and then directly inserting the environment to be used into the options rather than expecting the module_tool applications to retrieve the correct environment from any other loaders. Testing is now simpler, but because we are now comparing different but equal environments, I added equality and hash to node/environment to facilitate this. This in turn broke tests, because of Puppet::Node::Environment#known_resource_types which caches using the global $known_resource_types. Previously this would always clear itself when called if $known_resource_types.environment != self, but with the new node equality, state was now leaking between tests. The test_helper now sets $known_resource_types nil after each test.
2014-01-17(PUP-1118) Move global context methods to PuppetAndrew Parker1-1/+1
This moves the global context handling out of the Puppet::Context class and onto the Puppet module, which allows Puppet::Context to be a more generic, overridable context system. It also allows references to context information to be a little bit shorter. This doesn't tackle making settings information available in the context, and so there might be a little confusion between Puppet[] and Puppet.lookup.
2014-01-16(PUP-1118) Introduce "create" to make specific environmentsAndrew Parker1-10/+21
Environments are more than just a name, they are also a modulepath and a manifest. This commit makes a "create" method for setting up environments with specific modulepaths and manifests rather than relying on the Puppet Settings at the time that methods are called. In order to control environments for module installation they now take advantage of this in order to control the modulepath that things will be installed into.
2013-05-16Adding a couple additional tests for supplied version constraints.Pieter van de Bruggen1-0/+20
2013-04-30(#17824) PMT should not prefer pre-release versions to existing stable versions.Pieter van de Bruggen1-2/+29
2013-04-15(#11276) Enable module tool on WindowsJosh Cooper1-90/+70
This commit allows the module tool to run on windows and updates the spec tests as they are no longer pending.
2013-04-03(Maint) Don't use fails_on_windows to exclude spec testsJosh Cooper1-1/+1
In the 2.7 series, we used the fails_on_windows rspec filter to exclude unit tests on windows. In 3.x, that approach has been removed. Instead, if the test should never be expected to pass on Windows, then use an exclude filter like: describe Puppet::MyClass, :unless => Puppet.features.microsoft_windows? do However, if the test doesn't currently pass, but should sometime in the future, then use an rspec conditional pending block: pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do <example1> end
2012-07-02(#15202) Handle paths with files in themAndrew Parker1-38/+34
When creating the install path, if there is a file in the way then there was an unhandled exception. This commit extracts out a install directory handling code for ease of testing and adds handling for this case. This class excapsulates the logic of preparing the installation directory for modules. As we find more operations on the installation directory we should try to move them to this class.
2012-06-29(#15202) Make puppet module install create parent directoriesJeff McCune1-0/+51
Without this patch, the puppet module install command will fail when run as a normal user account without a ~/.puppet directory. The error is: $ puppet module install puppetlabs-cloud_provisioner Preparing to install into /Users/jeff/.puppet/modules ... Error: Could not install module 'puppetlabs-cloud_provisioner' (latest) Directory /Users/jeff/.puppet/modules does not exist This is a problem because it adds friction to the process of getting started with Puppet. This patch fixes the problem by creating the directory if the path does not already exist. If the path does exist, then the error is still thrown, but has been modified slightly to provide helpful next actions. The error when the path exists as a non-directory looks like: Error: Could not install module 'puppetlabs-cloud_provisioner' (latest) The reason is path '/Users/jeff/.puppet/modules' is not a directory. A potential solution is `mkdir -p '/Users/jeff/.puppet/modules'`. This patch also handles the situation where the target path does not exist but the effective uid of the puppet process does not have access to create the directory. The error message in this case looks like: Error: Could not install module 'puppetlabs-cloud_provisioner' (latest) Permission is denied when trying to create directory '/Users/jeff/.puppet/modules'. A potential solution is to check the ownership and permissions of parent directories.
2012-05-11(#14387) Puppet's Module face should send a User-AgentAndrew Parker1-17/+15
The User-Agent will provide the server with some information about the version of the module tool, the version of puppet, and the version of ruby that is being used. This commit also ensures that Puppet::Forge does not depend on the Puppet::Face code. In order to achieve that the module face now is responsible for creating the correct Puppet::Forge object and handing that to the various components of the face for execution. The Puppet::Face now provides an interface for interacting with the repository in ways that various users were doing by asking for the repository directly.
2012-04-24Merge 2.7.x into master.Daniel Pittman1-9/+9
This manually fixes up a pile of Puppet Module Tool conflicts by hand, related to overlapping changes with nothing but textual translation. The rest of the merge was smooth and simple. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-04-23(#13682) Rename Puppet::Module::Tool to Puppet::ModuleToolJeff McCune1-9/+9
Without this patch, Puppet will monkey patch the existing implementation of the puppet-module Gem if it is used. This is bad because the two implementations are all jumbled up inside of one another and behavior may become unpredictable. Warnings are also displayed directly to the end user in the form of redefined constants. This patch fixes the problem by renaming Puppet::Module::Tool inside of Puppet to Puppet::ModuleTool This fixes the problem because Puppet will no longer monkey-patch the Puppet::Module::Tool module inside of the puppet-module Gem. This patch also has the added benefit of making the Module's name match up with the CamelCase filepath (puppet/module_tool/ => Puppet::ModuleTool) As a result, no file moves are necessary.
2012-04-18Use conditional pending to block out "fails_on_windows" tests.Daniel Pittman1-58/+75
A whole bunch of tests scattered through the system fail on Windows, around features that are not supported on that platform. (They are things that only the master does, which an agent-only platform doesn't need to support.) These were tagged `fails_on_windows` to allow filtering them from rspec runs, which is great, but doesn't actually communicate nearly as much useful information as it would if we used the "conditionally pending" facilities that rspec has supported since 2.3. That gives us two key things: one, it works automatically based on our knowledge of the platform, which means you can't forget to turn off failing tests. Two, it means that if the test starts unexpectedly passing we also get a failure, since we should respond to "works when it shouldn't" as seriously as "fails when it shouldn't". Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Add Module ToolMatt Robinson1-0/+205
This rather large commit includes all the work needed to get the `puppet module` face in Puppet with all it's actions. I tried to break this up into smaller commits, but it was difficult to do so and keep the individual commits in a state that had passing specs since many changes in shared module_tool code affected multiple actions. This code was developed in an integration branch over a few montsh and is now being merged back into Puppet core in the same state that shipped with Puppet Enterprise 2.5. The work here was done by Pieter van de Bruggen <pieter@puppetlabs.com>, Kelsey Hightower <kelsey@puppetlabs.com> and myself.