Skip to content
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

[MODULES-10759] - set a default value if custom facts fails #223

Merged
merged 2 commits into from
Aug 21, 2020
Merged

[MODULES-10759] - set a default value if custom facts fails #223

merged 2 commits into from
Aug 21, 2020

Conversation

adrianiurca
Copy link

No description provided.

@adrianiurca adrianiurca requested a review from a team as a code owner August 17, 2020 18:26
@puppet-community-rangefinder
Copy link

chocolatey::params is a class

that may have no external impact to Forge modules.

This module is declared in 5 of 575 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@adrianiurca adrianiurca changed the title set a default value if custom facts fails [MODULES-10759] - set a default value if custom facts fails Aug 18, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2020

Codecov Report

Merging #223 into main will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   88.23%   88.36%   +0.13%     
==========================================
  Files          13       13              
  Lines         748      748              
==========================================
+ Hits          660      661       +1     
+ Misses         88       87       -1     
Impacted Files Coverage Δ
lib/puppet_x/chocolatey/chocolatey_common.rb 100.00% <0.00%> (+2.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d41dc3d...fd19cfa. Read the comment docs.

@adrianiurca
Copy link
Author

adrianiurca commented Aug 18, 2020

parallel_spec results:
I, [2020-08-18T14:07:28.785167 #75774] INFO -- : Creating symlink from spec/fixtures/modules/chocolatey to /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey
Cloning into 'spec/fixtures/modules/facts'...
Cloning into 'spec/fixtures/modules/provision'...
Cloning into 'spec/fixtures/modules/puppet_agent'...
remote: Enumerating objects: 71, done.
remote: Counting objects: 100% (71/71), done.
remote: Compressing objects: 100% (56/56), done.
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (56/56), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 71 (delta 6), reused 45 (delta 4), pack-reused 0
remote: Enumerating objects: 185, done.
Unpacking objects: 100% (71/71), done.5)
remote: Counting objects: 100% (185/185), done.
remote: Total 56 (delta 10), reused 28 (delta 2), pack-reused 0
Unpacking objects: 100% (56/56), done.
remote: Compressing objects: 100% (166/166), done.
remote: Total 185 (delta 24), reused 90 (delta 8), pack-reused 0
Receiving objects: 100% (185/185), 135.94 KiB | 206.00 KiB/s, done.
Resolving deltas: 100% (24/24), done.
Notice: Preparing to install into /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules ...
Notice: Preparing to install into /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules ...
Notice: Preparing to install into /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules
└── puppetlabs-registry (v3.1.1)
Notice: Installing -- do not interrupt ...
/Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules
└── puppetlabs-powershell (v4.0.0)
Notice: Installing -- do not interrupt ...
/Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/fixtures/modules
└── puppetlabs-stdlib (v6.3.0)
12 processes for 15 specs, ~ 1 specs per process
Run options: exclude {:bolt=>true}

Chocolatey Install Location
using normal install path
on Windows
Run options: exclude {:bolt=>true}

Chocolatey Common
.chocolatey_command
Run options: exclude {:bolt=>true}

Chocolatey Version
on Windows
when Chocolatey is installed
Run options: exclude {:bolt=>true}

chocolatey
contains config.pp
with older choco installed
enable_autouninstaller => true
Run options: exclude {:bolt=>true}

chocolatey
{}
Run options: exclude {:bolt=>true}

Puppet::Type::Chocolateyfeature::ProviderWindows
verify provider
Run options: exclude {:bolt=>true}

Puppet::Type::Chocolateysource::ProviderWindows
verify provider
Run options: exclude {:bolt=>true}

choco_install_path fact
on Windows
Run options: exclude {:bolt=>true}

Puppet::Type::Chocolateyconfig::ProviderWindows
verify provider
Run options: exclude {:bolt=>true}

chocolatey
contains install.pp
choco_install_location => c:\local_folder
returns install path from registry if it exists (PENDING: Not on Windows platform)
finds chocolatey install location based on PuppetX::Chocolatey::ChocolateyInstall (PENDING: Not on Windows platform)
Run options: exclude {:bolt=>true}

Puppet::Type::Chocolateysource
returns the environment variable ChocolateyInstall if it exists (PENDING: Not on Windows platform)
finds chocolatey install location based on default location (PENDING: Not on Windows platform)
.choco_version
returns nil if the environment variable does not exist (PENDING: Not on Windows platform)
on Linux
returns PuppetX::Chocolatey::ChocolateyVersion.version
.choco_config_file
returns the value from running choco -v (PENDING: Not on Windows platform)
returns the normal config file location when found
returns the environment variable ChocolateyInstall if it exists
handles cleaning up spaces (PENDING: Not on Windows platform)
returns the old config file location for older installs
returns nil if the ChocolateyInstall variable does not exist
using temp directory
handles older versions of choco (PENDING: Not on Windows platform)
returns the TEMP path from registry if it exists (PENDING: Not on Windows platform)
handles other messages that return with version call (PENDING: Not on Windows platform)
returns nil when the config cannot be found
handles a trailing line break (PENDING: Not on Windows platform)
returns nil path from registry if it does not exist (PENDING: Not on Windows platform)
handles 0.9.8.33 of choco (PENDING: Not on Windows platform)
When Chocolatey is not installed

Deprecation Warnings:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. Chocolatey Common .chocolatey_command finds chocolatey install location based on PuppetX::Chocolatey::ChocolateyInstall

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_common_spec.rb:19

  2. Chocolatey Common .chocolatey_command finds chocolatey install location based on default location

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_common_spec.rb:26

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 0.25386 seconds (files took 2.97 seconds to load)
6 examples, 0 failures, 2 pending

  returns nil (PENDING: Not on Windows platform)

on Linux

Deprecation Warnings:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. Chocolatey Install Location using normal install path on Windows returns install path from registry if it exists

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_install_spec.rb:13

  2. Chocolatey Install Location using normal install path on Windows returns the environment variable ChocolateyInstall if it exists

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_install_spec.rb:20

  3. Chocolatey Install Location using normal install path on Windows returns nil if the environment variable does not exist

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_install_spec.rb:29

  4. Chocolatey Install Location using temp directory returns the TEMP path from registry if it exists

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_install_spec.rb:67

  5. Chocolatey Install Location using temp directory returns nil path from registry if it does not exist

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_install_spec.rb:73

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 0.2985 seconds (files took 2.95 seconds to load)
7 examples, 0 failures, 5 pending

returns the output of PuppetX::Chocolatey::ChocolateyInstall.install_path (PENDING: Not on Windows platform)
returns nil on a non-windows system
returns the default path when PuppetX::Chocolatey::ChocolateyInstall.install_path is nil (PENDING: Not on Windows platform)

Puppet::Type::Chocolateyconfig

Deprecation Warnings:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. Chocolatey Version on Windows when Chocolatey is installed returns the value from running choco -v

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:18

  2. Chocolatey Version on Windows when Chocolatey is installed handles cleaning up spaces

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:24

  3. Chocolatey Version on Windows when Chocolatey is installed handles older versions of choco

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:30

  4. Chocolatey Version on Windows when Chocolatey is installed handles other messages that return with version call

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:36

  5. Chocolatey Version on Windows when Chocolatey is installed handles a trailing line break

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:42

  6. Chocolatey Version on Windows when Chocolatey is installed handles 0.9.8.33 of choco

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:48

  7. Chocolatey Version on Windows When Chocolatey is not installed returns nil

    Not on Windows platform

    ./spec/unit/puppet_x/chocolatey/chocolatey_version_spec.rb:62

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 0.27175 seconds (files took 3.01 seconds to load)
8 examples, 0 failures, 7 pending

is an instance of Puppet::Type::Chocolateyfeature::ProviderWindows
is an instance of Puppet::Type::Chocolateyconfig::ProviderWindows
is an instance of Puppet::Type::Chocolateysource::ProviderWindows

is an instance of Puppet::Type::Chocolateysource
has a enable method
has a create method
has a create method
is an instance of Puppet::Type::Chocolateyconfig
has an exists? method
has an exists? method
has an exists? method
has a disable method
parameter :name should be the name var
has a destroy method
has a disable method
parameter :name should be the name var
has a properties method
has a properties method
has a destroy method
has a query method
has a query method
properties
:value
autorequires Exec[install_chocolatey_official] when in the catalog
parameter :name
has a properties method
has the standard feautures method
autorequires Exec[install_chocolatey_official] when in the catalog
parameter :name
accepts c:\cache
has a query method
properties
:location
accepts any string value
parameter :location
returns nil feature when element is nil
self.read_choco_features
Run options: exclude {:bolt=>true}

Puppet::Type::Package::ProviderChocolatey
accepts 2700
accepts c:\packages
does not allow nil
errors when the config file location is null
accepts 'value with spaces'
self.read_configs
accepts http://somelocation/packages
accepts any string value
parameter :user
errors when the config file is not found
when getting features from the config file
errors when the config file location is null
accepts \unc\share\packages
:user
does not allow empty
matches the count of features in the config
errors when the config file is not found
when getting configs from the config file
accepts any string value
parameter :password
accepts 'bob'
contains xml elements
self.get_choco_feature
accepts any string value
parameter :value
matches the count of configs in the config
accepts 'domain\bob'
accepts any string value
parameter :bypass_proxy
returns nil feature when element is nil
contains xml elements
self.get_config
accepts api keys like 'api123-456-243 d123'
:password
does not allow nil
converts an element to a feature
returns nil config when element is nil
accepts 'bob'
accepts any valid boolean value
parameter :admin_only
when feature is disabled

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 1.09 seconds (files took 3.08 seconds to load)
15 examples, 0 failures

converts an element to a config

.validation
does not allow empty
accepts api keys like 'api123-456-243 d123'
:bypass_proxy
accepts any valid boolean value
parameter :allow_self_service
does not error when Chocolatey is not installed
accepts 'true' as a string
does not error when the minimum version is met
accepts any string value
param :ensure
accepts 'true as a boolean'
:allow_self_service
accepts any valid boolean value
parameter :priority
errors when the minimum version is not met
accepts 'true' as a string
is an instance of Puppet::Type::Package::ProviderChocolatey
accepts 'present'
has an install method
errors when the property_hash is empty, :ensure is :present, and no :value is supplied
has an uninstall method
accepts 'true as a boolean'
:admin_only
has an update method
has a latest method
parameter :source
accepts any numeric value
defaults to nil
accepts c:\packages
accepts http://somelocation/packages
does not error when the property_hash is defined, even if :ensure is :present and no :value is supplied
accepts \unc\share\packages
self.read_choco_features
accepts 'true' as a string
accepts present
errors when the config file location is null
errors when the config file is not found
when getting sources from the config file
does not error when the property_hash is empty, :ensure is :present and a :value is supplied
accepts any string that represents a numeric value
matches the count of sources in the config
accepts 'true as a boolean'
self.read_sources
contains xml elements
self.get_choco_feature
returns nil source when element is nil
does not error when the property_hash is empty, :ensure is :absent and no :value is supplied
.flush
converts an element to a source
self.choco_features
errors when the config file location is null
accepts absent
returns an array of hashes
when installing
with compiled choco client
uses install command without versioned package
does not accept other string values
ensures a config setting is set
calls with ignore package exit codes when = 0.9.10 and not explicitly configured to use them
errors when the config file is not found
when getting sources from the config file
calls with ignore package exit codes when > 0.9.10 and not explicitly configured to use them
does not ignore package exit codes when = 0.9.10 and explicitly configured to use them
rejects any other value
ensures a config setting is removed
calls no progress when = 0.10.4 and not using verbose package options

Deprecation Warnings:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. choco_install_path fact on Windows returns the output of PuppetX::Chocolatey::ChocolateyInstall.install_path

    Not on Windows platform

    ./spec/unit/facter/choco_install_path_spec.rb:17

  2. choco_install_path fact on Windows returns the default path when PuppetX::Chocolatey::ChocolateyInstall.install_path is nil

    Not on Windows platform

    ./spec/unit/facter/choco_install_path_spec.rb:23

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 1.56 seconds (files took 3.1 seconds to load)
15 examples, 0 failures, 2 pending

  matches the count of sources in the config
does not accept symbol values

param :ensure
calls no progress when > 0.10.4 and not using verbose package options
provides an error message when choco execution fails
calls no progress when = 0.10.4 and verbose package option specified
uses upgrade command with versioned package

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 1.62 seconds (files took 3.11 seconds to load)
25 examples, 0 failures

  calls install instead of upgrade if package name ends with .config
  contains xml elements

self.get_source
uses source if it is specified
with posh choco client
uses install command without versioned package
accepts 'present'
uses update command with versioned package
uses source if it is specified
when holding
with compiled choco client
returns nil source when element it nil
uses install command with held package
with posh choco client
throws an argument error with held package
when uninstalling
with compiled choco client
compiles successfully
calls the remove operation
is expected to contain Class[chocolatey]
calls with ignore package exit codes when = 0.9.10
is expected to contain Class[chocolatey::params]
converts an element to a source
is expected not to contain Exec[chocolatey_autouninstaller_enable]
is expected to contain Exec[install_chocolatey_official] with creates => "c:\local_folder\bin\choco.exe"
choco_install_location => C:\ProgramData\chocolatey
is expected to contain Class[chocolatey::install]
accepts present
calls with ignore package exit codes when > 0.9.10
is expected not to contain Exec[chocolatey_autouninstaller_enable] with command => "C:\ProgramData\chocolatey\bin\choco.exe feature -r enable -n autoUninstaller"
enable_autouninstaller => false
is expected to contain Class[chocolatey::config]
accepts install_proxy parameter
uses ignore source if it is specified and the version is less than 0.9.10
uses source if it is specified and the version is at least 0.9.10
uses source if it is specified and the version is greater than 0.9.10
with posh choco client
calls the remove operation
converts a bare bones element to a source
uses source if it is specified
when updating
with compiled choco client
uses chocolatey upgrade when ensure latest and package present
is expected to contain Exec[install_chocolatey_official] with creates => "C:\ProgramData\chocolatey\bin\choco.exe"
choco_install_timeout_seconds => 1500
calls with ignore package exit codes when = 0.9.10
compiles successfully
chocolatey_download_url =>
https://chocolatey.org/api/v2/package/chocolatey/
is expected not to contain Exec[chocolatey_autouninstaller_disable]
accepts :disabled
calls with ignore package exit codes when > 0.9.10
is expected not to contain Exec[chocolatey_autouninstaller_disable] with command => "C:\ProgramData\chocolatey\bin\choco.exe feature -r disable -n autoUninstaller"
without choco installed
enable_autouninstaller => true
when source is disabled
.validation
calls with no-progress when = 0.10.4 and package_settings: verbose is not true
calls with no-progress when > 0.10.4 and package_settings: verbose is not true
does not call with no-progress when = 0.10.4 and package_settings: verbose is true
does not warn when both user/password are empty
compiles successfully
http://location
uses chocolatey install when ensure latest and package absent
is expected to contain Exec[install_chocolatey_official] with timeout => "1500"
choco_install_timeout_seconds => 35
uses source if it is specified
with posh choco client
uses chocolatey update when ensure latest and package present
is expected not to contain Exec[chocolatey_autouninstaller_enable]
accepts absent
uses chocolatey install when ensure latest and package absent
is expected not to contain Exec[chocolatey_autouninstaller_enable] with command => "C:\ProgramData\chocolatey\bin\choco.exe feature -r enable -n autoUninstaller"
enable_autouninstaller => false
uses source if it is specified
when getting latest
with compiled choco client
throws when choco version is less than the minimum supported version
uses choco.exe arguments
uses source if it is specified
with posh choco client
compiles successfully
file:///c:/somwhere/chocolatey.nupkg
uses posh arguments
is expected to contain Exec[install_chocolatey_official] with timeout => "35"
use_7zip => false
uses source if it is specified
query
returns a hash when chocolatey and the package are present
writes a debug message on password when password is not empty
returns nil when the package is missing
when fetching a package list
is expected not to contain Exec[chocolatey_autouninstaller_disable]
rejects any other value
.validate
is expected not to contain Exec[chocolatey_autouninstaller_disable] with command => "C:\ProgramData\chocolatey\bin\choco.exe feature -r disable -n autoUninstaller"
with choco.exe installed
enable_autouninstaller => true
invokes provider listcmd
does not warn on user/password on newer choco versions
compiles successfully
\ciflocation\share
is expected not to contain File[C:\Temp\7za.exe]
use_7zip => true
seven_zip_download_url default
queries chocolatey
self.instances
returns nil on error
with compiled choco client
returns installed packages with their versions
returns nil on error
with posh choco client
passes when both user/password are empty
does not warn on user/password when choco version is the minimum supported version
returns installed packages with their versions
is expected to contain Exec[chocolatey_autouninstaller_enable]

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 1.45 seconds (files took 3.76 seconds to load)
62 examples, 0 failures

    is expected to contain Exec[chocolatey_autouninstaller_enable] with command => "C:\\ProgramData\\chocolatey\\bin\\choco.exe feature -r enable -n autoUninstaller"
  enable_autouninstaller => false
  compiles successfully
bob (invalid scenario)
does not warn on bypass_proxy when choco version is newer than the minimum supported version
passes when both user/password have a value
    is expected to contain File[C:\Temp\7za.exe] with source => "https://chocolatey.org/7za.exe"
  seven_zip_download_url => 'https://packages.organization.net/7za.exe'
does not warn on bypass_proxy when choco version is the minimum supported version
  is expected to raise Puppet::Error with message matching /Stdlib::Filesource/
4 (invalid scenario)
    is expected to contain Exec[chocolatey_autouninstaller_disable]
warns on bypass_proxy when choco version is less than the minimum supported version
    is expected to contain Exec[chocolatey_autouninstaller_disable] with command => "C:\\ProgramData\\chocolatey\\bin\\choco.exe feature -r disable -n autoUninstaller"

chocolateyversion fact
on Windows
returns the output of PuppetX::Chocolatey::ChocolateyVersion.version (PENDING: Not on Windows platform)
fails when user has a value but password does not
is expected to contain File[C:\Temp\7za.exe] with source => "https://packages.organization.net/7za.exe"

Puppet::Type::Chocolateyfeature
returns the default of 0 when PuppetX::Chocolatey::ChocolateyVersion.version is nil (PENDING: Not on Windows platform)

Pending: (Failures listed here are expected and do not affect your suite's status)

  1. chocolateyversion fact on Windows returns the output of PuppetX::Chocolatey::ChocolateyVersion.version

    Not on Windows platform

    ./spec/unit/facter/chocolateyversion_spec.rb:17

  2. chocolateyversion fact on Windows returns the default of 0 when PuppetX::Chocolatey::ChocolateyVersion.version is nil

    Not on Windows platform

    ./spec/unit/facter/chocolateyversion_spec.rb:23

Deprecation Warnings:

  is expected to raise Puppet::Error with message matching /Stdlib::Filesource/

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total
(invalid scenario)

Finished in 2.33 seconds (files took 3.01 seconds to load)
14 examples, 0 failures, 2 pending

does not warn on allow_self_service when choco version is newer than the minimum supported version
fails when password has a value but user does not
  is expected to raise Puppet::Error with message matching /Stdlib::Filesource/
false (invalid scenario)
does not warn on allow_self_service when choco version is the minimum supported version

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 2.28 seconds (files took 3.13 seconds to load)
23 examples, 0 failures

is an instance of Puppet::Type::Chocolateyfeature
is expected to raise Puppet::Error with message matching /Stdlib::Filesource/
3 (invalid scenario)
warns on allow_self_service when choco version is less than the minimum supported version
is expected to raise Puppet::Error with message matching /Stdlib::Filesource/
choco_install_location =>
C:\ProgramData\chocolatey
does not warn on admin_only when choco version is newer than the minimum supported version
parameter :name should be the name var
parameter :name
does not warn on admin_only when choco version is the minimum supported version
compiles successfully
D:\somewhere
accepts any string value
param :ensure
warns on admin_only when choco version is less than the minimum supported version
does not warn if priority is not set
compiles successfully
1 (invalid scenario)
accepts 'enabled'
is expected to raise Puppet::Error with message matching /Stdlib::Windowspath/
false (invalid scenario)
does not warn if priority is not set on older unsupported versions
does not warn if priority is 0 on unsupported versions
is expected to raise Puppet::Error with message matching /Stdlib::Windowspath/
https://somewhere (invalid scenario)
accepts enabled
does not warn on priority when choco version is newer than the minimum supported version
is expected to raise Puppet::Error with message matching /Stdlib::Windowspath/
\overhere (invalid scenario)
accepts 'disabled'
is expected to raise Puppet::Error with message matching /Stdlib::Windowspath/
(invalid scenario)
does not warn on priority when choco version is the minimum supported version
warns on priority when choco version is less than the minimum supported version
is expected to raise Puppet::Error with message matching /Stdlib::Windowspath/
choco_install_timeout_seconds =>
1500
accepts :disabled
compiles successfully
8000
passes when ensure is not present and location is empty
rejects any other value

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 2.75 seconds (files took 3.1 seconds to load)
15 examples, 0 failures

  compiles successfully
string (invalid scenario)
  is expected to raise Puppet::Error with message matching /expects an Integer value/
false (invalid scenario)
  is expected to raise Puppet::Error with message matching /expects an Integer value/
(invalid scenario)
fails when ensure => present and location is empty

.flush
is expected to raise Puppet::Error with message matching /expects an Integer value/
1 (invalid scenario)
ensures a source is present with minimal values set
is expected to raise Puppet::Error with message matching /expects an Integer value/
30 (invalid scenario)
ensures a source is present with all values set
is expected to raise Puppet::Error with message matching /expects an Integer value/
use_7zip =>
true
sets priority when present
compiles successfully
false
sets bypass_proxy when present
compiles successfully
true (invalid scenario)
sets allow_self_service when present
is expected to raise Puppet::Error with message matching /expects a Boolean value/
false (invalid scenario)
sets admin_only when present
is expected to raise Puppet::Error with message matching /expects a Boolean value/
bob (invalid scenario)
sets user and password when user is present
is expected to raise Puppet::Error with message matching /expects a Boolean value/
3 (invalid scenario)
is expected to raise Puppet::Error with message matching /expects a Boolean value/
4 (invalid scenario)
sets user and password when choco version is the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
(invalid scenario)
does not set bypass_proxy when choco version is less than the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
enable_autouninstaller =>
true
sets bypass_proxy when choco version is the minimum supported version
compiles successfully
false
does not set allow_self_service when choco version is less than the minimum supported version
compiles successfully
true (invalid scenario)
sets allow_self_service when choco version is the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
false (invalid scenario)
sets admin_only when choco version is the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
bob (invalid scenario)
sets priority when choco version is newer than the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
3 (invalid scenario)
sets priority when choco version is the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
4 (invalid scenario)
does not set priority when choco version is less than the minimum supported version
is expected to raise Puppet::Error with message matching /expects a Boolean value/
(invalid scenario)
is expected to raise Puppet::Error with message matching /expects a Boolean value/
disables a source when ensure => disabled

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 3.61 seconds (files took 3.04 seconds to load)
45 examples, 0 failures

removes a source when ensure => absent
provides an error message when choco execution fails

Code coverage
must cover at least 0% of resources
Total resources: 9
Touched resources: 7
Resource coverage: 77.78%

Untouched resources:
File[\7za.exe]
Registry_value[ChocolateyInstall environment value]

Deprecation Warnings:

Using any_instance from rspec-mocks' old :should syntax without explicitly enabling the syntax is deprecated. Use the new :expect syntax or explicitly enable :should instead. Called from /Users/adrian.iurca/Desktop/projects/adrianiurca/puppetlabs-chocolatey/spec/spec_helper_local.rb:12:in `block in <top (required)>'.

If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
config.raise_errors_for_deprecations!, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

Finished in 3.71 seconds (files took 3.09 seconds to load)
71 examples, 0 failures

306 examples, 0 failures, 18 pendings

Took 8 seconds

@carabasdaniel carabasdaniel merged commit d56d46e into puppetlabs:main Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants