summaryrefslogtreecommitdiff
path: root/spec/unit/face/module/install_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-07-21(maint) Cleanup specs for the `module` Face’s `install` action.Pieter van de Bruggen1-8/+8
Prior to this change, the specs relied on a fragile chain of stubbed expectations, which changes elsewhere in the application have rendered incorrect and non-operational. This change aims to improve these specs by stubbing less and making more robust assertions about the data.
2014-04-04(PUP-2093) Migrate PMT to /v3 API.Pieter van de Bruggen1-85/+14
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-02-18(PUP-1584) module_tool uses current_environment with target_dir overridesJosh Partlow1-104/+21
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.
2012-07-11Merge commit 'ecc52ed' into 3.0rcPatrick Carlisle1-1/+12
* commit 'ecc52ed': (33 commits) (#11868) Use `Installer` automation interface to query package state Eliminate require calls at runtime. Fix broken TransBucket transformation tests. Fix broken ability to remove resources from the catalog. Fix type check when transforming catalog. Fix all trivial "should to must" errors in our tests. Enforce "must not should" on Puppet::Type instances in tests. Initialize resources strictly in backup specs Refactor file backup specs (maint) Add tags to .gitingore Use in memory sqlite database for unit tests (#14715) Use gtar with 'puppet module install' on Solaris Stub pkginfo when installing in openbsd spec (#14962) PMT doesn't support setting a relative modulepath (#15078) Document USR2 log rotation signal (#14909) Update createpackage.sh to resolve permissions issues (maint) Add --test to puppet run (maint) Add symlink stub to gentoo service provider spec Add comment to upstart provider explaining exclusion of 'wait-for-state' Upstart code cleanup, init provider improvement ... Conflicts: lib/puppet/face/module/install.rb lib/puppet/network/handler/fileserver.rb lib/puppet/parser/functions/fqdn_rand.rb lib/puppet/parser/type_loader.rb lib/puppet/ssl/base.rb lib/puppet/util.rb lib/puppet/util/autoload.rb man/man8/puppetmasterd.8 spec/lib/puppet_spec/database.rb spec/unit/face/module/install_spec.rb spec/unit/other/transbucket_spec.rb spec/unit/provider/augeas/augeas_spec.rb spec/unit/util/backups_spec.rb spec/unit/util_spec.rb
2012-07-02(#15202) Handle paths with files in themAndrew Parker1-1/+7
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-24(#14962) PMT doesn't support setting a relative modulepathKen Barber1-2/+13
We previously fixed expansion for the target_dir, but this only worked when the target_dir was set explicitly, it didn't support relative paths being passed in the modulepath. This patch fixes that and adds tests. As a side-effect, this should also fixes cases where the first modulepath defined in the configuration file is relative. It also corrects the tests previously applied for expanding the target_dir, as it used to rely on expanding the target_dir before adding it to the modulepath. This wasn't necessary, so now we don't bother testing that the targetdir is expanded in the modulepath after being added. Acceptance tests have been added for testing modulepath, with absolute and relative paths.
2012-05-14(maint) Manually resolve broken merge of 2.7.xKelsey Hightower1-0/+11
This patch resolves a merge conflict with 2.7.x, mainly around some changes in the PMT installer face options.
2012-05-14Use absolute_path in module install specPatrick Carlisle1-4/+5
This fixes the module install spec on windows
2012-05-14Revert "Merge branch '2.7.x'"Kelsey Hightower1-11/+0
This reverts commit 34ad902015afbd3f8d7597207a1cb4d5cd4cc011, reversing changes made to 639f995c91289b3be9ca5347865247907c7dcb5c.
2012-05-14Merge branch '2.7.x'Kelsey Hightower1-0/+11
2012-05-14(#14424) Expand path of the target directoryKelsey Hightower1-0/+11
This patch expands the path of the target installation directory and will prevent the following errors: Error: undefined method `each' for nil:NilClass
2012-05-11(#14387) Puppet's Module face should send a User-AgentAndrew Parker1-17/+26
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-30(#14229) Add a path type to settingsPatrick Carlisle1-4/+5
This path type will expand all paths in a string separated by File::PATH_SEPARATOR, but does not add the paths to the settings catalog. This helps the most on Windows, where it means that paths given to settings will consistently use File::SEPARATOR, no matter how they were entered by the user.
2012-04-24Merge 2.7.x into master.Daniel Pittman1-10/+10
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-17(#13898) Fail Face when option collides w/ settingJeff Weiss1-2/+2
Change Puppet::Interface::Option to prohibit options on Faces that have the same name as an existing Puppet setting. Move functionality of Puppet::Util::Setting::StringSetting.setbycli to Puppet::Util::Settings and deprecate usage of StringSetting.setbycli because StringSetting provides metadata for the definition of setting, whereas Setting contains both the value and the origin of the value, whether :cli, :memory, :application_defaults, etc. Change ca application and certificate Face to properly handle all permutations of --dns_alt_names (Puppet setting) and --dns-alt-names (Face option). Remove "documentation only" options of :modulepath and :environment from module Face. Prior to this commit, Faces could declare options that collided with existing Puppet settings, which has caused unexpected behavior for the Face. This commit explicitly prohibits the Face from declaring an option which is already a Puppet setting. This is a potentially breaking change for externally developed Faces.
2012-03-30Add Module ToolMatt Robinson1-0/+158
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.
2012-02-15(#12631) Remove puppet module faceMatt Robinson1-75/+0
The current state of the module face was deemed not ready for shipping because there was insufficient testing and formatting. This removes the parts of the code that make the module face accessible as a face application, and the accompanying tests. This change will be reverted after the 2.7.11rc is cut so that work can continue on the module face for the next release.
2012-01-23Revert "(#11600) Remove module face"Matt Robinson1-0/+75
This reverts commit d6d6e60fc04aa2baa678b5b36c00c5878696018f. Now that 2.7.10rc has been cut, we will continue work on the module face to make it releaseable for the next 2.7.x release. To do that, we need the core face and application for `puppet module` put back into the codebase.
2012-01-18(#11600) Remove module faceMatt Robinson1-75/+0
This commit removes the face related code and tests since it was determined they didn't meet design specifications well enough for the upcoming release. This leaves the module_tool related code in, but it's not accessible through any supported interface. This will make it easy for us to get this removed code back in after the release and continue development for the next release.
2011-12-07(#11276) Fix module install specs that fail on windowsMatt Robinson1-1/+2
expand_path is our friend for cross platform testing. Also, need to require module_tool in order to run the install_spec.rb on its own.
2011-12-06(#7656) Rename module_tool face to moduleKelsey Hightower1-0/+74
Before this patch the module face was named module_tool, this is not a very attractive name. Look at it, you have to type an underscore just to use it. This patch fixes this issue by simply renaming the face from module_tool to module. The patch does not change the name of the module tool library files, doing so would cause a conflict on the existing `lib/puppet/module.rb` module.