summaryrefslogtreecommitdiff
path: root/spec/unit/provider/package
Commit message (Collapse)AuthorAgeFilesLines
* Temporarily pend a troublesome testmp/knife-gem-3Marc A. Paradise2021-03-101-1/+3
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Move idempotency logs to debugPhil Dibowitz2021-03-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This was discussed in the last Chef Triage meeting. In the great move to trace logging, which is great, idempotency check logs moved to trace, which defeats the purpose. The goal is to keep "internal chef" logging in trace so that when users are trying to figure out why their cookbook isn't acting as expected they can look at debug without having to see all the other cruft. But "here's why I didn't install the package you said to install" is table-steaks "I'm trying to debug my cookbook." This moves those logs back to debug. There were a variety of cases where logging was pretty nonstandard in other ways, but to keep this PR scoped, I didn't change those. I did fix a few related logging issues: * A few warns that should have been debug in windows_task * A few places where there was basically no logging whatsoever, I put a few of the "I did X" logs to 'debug' (from trace). It coudl be argued some of those should be 'info', but that's a bigger change that I didn't want to put into this PR Signed-off-by: Phil Dibowitz <phil@ipom.com>
* Fix downgrades in apt_package (#10993)Phil Dibowitz2021-02-081-16/+82
| | | | | | | | | | | | | | | | | | | | `apt_package` never even looks at `new_resource.version` when deciding what version to install. That's silly. This fixes that. It requires the version be exact (as the `yum_package` did for most of Chef's history), and if you specify a non-existent version, it'll raise an exception. The unit tests for this provider are a bit of a mess, so I kinda stuck in the tests where I could. ``` [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] installed version for hub is 2.14.2-1vcrs.1 [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] candidate version for hub is 2.14.2-1vcrs.1 [2021-02-07T15:59:35-08:00] TRACE: apt_package[hub] hub 2.14.2-1vcrs.1 needs updating to 2.7.0~ds1-1vcrs.1 [2021-02-07T15:59:38-08:00] INFO: apt_package[hub] installed hub at 2.7.0~ds1-1vcrs.1 ``` Signed-off-by: Phil Dibowitz <phil@ipom.com>
* Fix DNF version comparison buglcg/dnf-fix-tweakLamont Granquist2021-01-281-1/+7
| | | | | | | Also suppresses a version comparison that normally fails when it is called on the dnf provider which was ignorable. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge remote-tracking branch 'origin/master' into mrtazz/pkgng-exit-code-fixDaniel Schauenberg2021-01-0733-4333/+4028
|\ | | | | | | Signed-off-by: Daniel Schauenberg <d@unwiredcouch.com>
| * Stub http requests in rubygems tests.Pete Higgins2020-12-281-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org> This commit includes a trimmed version of rubygems.org API output. To recreate this file: * Download the file from rubygems.org: curl "https://rubygems.org/latest_specs.4.8.gz" * Read the file, uncompress it, filter for the data you want, and reverse the process: File.write("latest_specs.4.8.gz", Gem::Util.gzip(Marshal.dump(Marshal.load(Gem::Util.gunzip(File.read("latest_specs.4.8.gz"))).select {|m| m.first == "sexp_processor" })))
| * Merge pull request #10379 from chef/rubygems_18Tim Smith2020-12-181-14/+4
| |\ | | | | | | Chef 17: Assume Rubygems 1.8 in the rubygems provider / specs
| | * Assume Rubygems 1.8 in the rubygems provider / specsrubygems_18Tim Smith2020-09-021-14/+4
| | | | | | | | | | | | | | | | | | | | | Rubygems 1.8 came out May 4, 2011 and we're still checking for rubygems older than that. Signed-off-by: Tim Smith <tsmith@chef.io>
| * | update zypper_packageLamont Granquist2020-11-111-25/+0
| | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | convert most internal powershell_out to powershell_execmwrock2020-10-281-2/+1
| | | | | | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
| * | ensure powershell_package commands are run with tls 1.2mwrock2020-10-201-95/+87
| | | | | | | | | | | | Signed-off-by: mwrock <matt@mattwrock.com>
| * | Resolve RuboCop Style/RedundantInterpolation warningsTim Smith2020-09-081-1/+1
| |/ | | | | | | | | | | Resolve the issues that pete pointed out plus a few others Signed-off-by: Tim Smith <tsmith@chef.io>
| * Add unit and integration testing back to omnibus testersLamont Granquist2020-08-172-2/+5
| | | | | | | | | | | | It is slow but it does catch real bugs Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * Merge pull request #10148 from chef/fix-spec_helper-requiresTim Smith2020-07-151-1/+1
| |\ | | | | | | Avoid requiring spec_helper more than once
| | * The spec/ directory is in the path.fix-spec_helper-requiresPete Higgins2020-07-131-1/+1
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Change non-default rubygems URL to default one for failing test.Pete Higgins2020-07-151-14/+1
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Workaround SSL cert verification failure in test.fix-rubygems-ssl-test-failurePete Higgins2020-07-141-0/+4
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Turn off ssl certificate verification in failing test.Pete Higgins2020-07-141-0/+9
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Factor out common test setup.Pete Higgins2020-07-141-9/+4
| | | | | | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * | Don't run the dnf test that Windows doesn't like on Windows.Pete Higgins2020-07-131-1/+1
| |/ | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Fix windows package tests.fix-windows-unit-testssnehaldwivedi2020-07-101-8/+13
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Refer to the new_resource directly.Pete Higgins2020-07-071-5/+5
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Update test for Windows package installer_type since the resource behavior ↵Pete Higgins2020-07-071-3/+3
| | | | | | | | | | | | changed. Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Update tests to match how Windows package checksums are done.Pete Higgins2020-07-071-38/+10
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Remove other top-level methods defined in tests and do a little cleanup.other-test-cleanupPete Higgins2020-06-241-20/+17
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Fix some odd whitespacing in tests.Pete Higgins2020-06-242-4/+4
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Add kitchen tests for snapdPhil Dibowitz2020-06-141-1/+1
| | | | | | | | Signed-off-by: Phil Dibowitz <phil@ipom.com>
| * Fixed Powershell_Package does not throw error when it cannot connect to ↵sanga172020-06-021-86/+95
| | | | | | | | | | | | powershell gallery Signed-off-by: sanga17 <sausekar@msystechnologies.com>
| * Get lib/ free of spelling violations.Pete Higgins2020-05-182-3/+3
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Align all our comments with the codeTim Smith2020-05-061-3/+3
| | | | | | | | | | | | Autocorrected with chefstyle after enabling that cop. It was very hard to read some complex autocorrected blocks w/o this. Signed-off-by: Tim Smith <tsmith@chef.io>
| * Fix for Chocolate_resource options causing extra quotesKapil/Github-9413_Chocolate_resource_options_causing_extra_quotesKapil Chouhan2020-04-231-1/+1
| | | | | | | | Signed-off-by: Kapil Chouhan <kapil.chouhan@msystechnologies.com>
| * added multipackage support for pacman resourceIngo Becker2020-04-201-147/+65
| | | | | | | | Signed-off-by: Ingo Becker <ingo@orgizm.net>
| * Use lamont's magic error handlingTim Smith2020-04-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tiny tweak to grab the first item so we actually get the hash back in the error handling. Given: ```ruby package %w{curl totally_junk_pkg} do action :upgrade end ``` ``` * No candidate version available for totally_junk_pkg ================================================================================ Error executing action `upgrade` on resource 'homebrew_package[curl, totally_junk_pkg]' ================================================================================ Chef::Exceptions::Package ------------------------- No candidate version available for totally_junk_pkg ``` Signed-off-by: Tim Smith <tsmith@chef.io>
| * Return empty hash from brew_info and avoid a bunch of nil checksmulti_packageTim Smith2020-04-171-5/+5
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Properly handle unavailable packagesTim Smith2020-04-171-0/+10
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Remove some empty specs I left behindTim Smith2020-04-171-38/+1
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Fix the upgrade action specsTim Smith2020-04-171-25/+20
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Test install / remove / purge actionsTim Smith2020-04-171-39/+68
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Update specs for brew_cmd_outputTim Smith2020-04-161-4/+4
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Add specs for available versionTim Smith2020-04-161-0/+12
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Update specs for brew_info and installed_versionTim Smith2020-04-161-93/+193
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Fix the load_current_resource specsTim Smith2020-04-161-17/+13
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-1322-22/+22
| | | | | | | | | | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * Add more typo fixesVivek Singh2020-04-073-3/+3
| | | | | | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
| * some spec typosVivek Singh2020-04-073-5/+5
| | | | | | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
| * Fix chefstyle violation.Pete Higgins2020-03-231-1/+1
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Make include_default_source nil by default and change implied logic.Pete Higgins2020-03-231-12/+119
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Clear sources if either a source or rubygems_url is set.Pete Higgins2020-03-231-1/+21
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Switch to canonical "https://rubygems.org" URL for rubygems.Pete Higgins2020-03-231-19/+19
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
| * Change the default value for :rubygems_url to be nil.Pete Higgins2020-03-231-8/+8
| | | | | | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>