Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7462

dsc : Travis CI broken to due to Gems 2.7.7

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None
    • MODULES Bug Template
    • Hide

      Travis CI runs should not fail.

      Show
      Travis CI runs should not fail.
    • Windows
    • 1
    • Windows 2018-07-18
    • Needs Assessment
    • Needs Assessment

    Description

      Ruby Gems 2.7.7 has changed the behavior of Gem::Version.correct? such that passing it nil as an argument returns false instead of true. This breaks the following line of code in all of the template generated type files in the module.

      confine :true => (Gem::Version.new(Facter.value(:powershell_version)) >= Gem::Version.new('5.0.10586.117'))

      This causes Travis CI pipelines to fail for this module. The following line of code shows an attempt to fix the issue without modifying the type files:

      describe Puppet::Type.type(:dsc_<%= resource.friendlyname.downcase %>),
      + :if => Puppet::Util::Platform.windows? do

      The attempt fails because the type is evaluated by rspec and throws an error before the guard has a chance to ensure the test is not run. If the type file is modified as shown below, the guard works and the test is not run in Travis, but the type has to be modified to not throw an error first.

      confine :true => (Gem::Version.new(Facter.value(:powershell_version) || '') >= Gem::Version.new('5.0.10586.117'))

      The module needs to be re built using an updated template as shown above to ensure type files do not through errors before a test guard has a change to ensure tests are not run in Travis.

      Attachments

        Activity

          People

            ethan Ethan Brown
            william.hurt William Hurt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support