Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7652

Update catalog_uuid acceptance test for Ruby yaml serialization changes

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Sub-team:
    • Team:
      Systems Engineering
    • Story Points:
      1
    • Sprint:
      Server 2017-06-14
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      The "catalog_uuid_correlates_catalogs_with_reports" test inspects the serialized content of the "catalog_uuid" field in the Puppet::Transaction::Report that the master stores. The test expects the value for the "catalog_uuid" field to not be quoted. With MRI Ruby 2.3.2 and later (and with JRuby 9.1.9.0, which emulates Ruby language version 2.3.3), some string-based UUID values are serialized to yaml with single quotes around them.

      On Ruby 2.3.1, for example, the following value is serialized without any surrounding quotes:

      › ruby -ryaml -e "puts '03080442-0449-43cb-8ec2-f26658f958ac'.to_yaml"
      --- 03080442-0449-43cb-8ec2-f26658f958ac
      

      On Ruby 2.3.2, however, the same command from above results in a value wrapped with single quotes:

      › ruby -ryaml -e "puts '03080442-0449-43cb-8ec2-f26658f958ac'.to_yaml"
      --- '03080442-0449-43cb-8ec2-f26658f958ac'
      

      Note that this only happens in Ruby 2.3.2+ with some values. For example, the following is produced under Ruby 2.3.2 and later:

      › ruby -ryaml -e "puts 'caaf2053-7398-410f-8ede-407bbe934162'.to_yaml"
      --- caaf2053-7398-410f-8ede-407bbe934162
      

      While the difference in serialized output between the Ruby versions is odd, I'm not sure that it's technically a "bug" in that the source value for the catalog_uuid is a string and characters like "-" arguably could warrant quoting whenever they are serialized out to yaml.

      For this ticket, I think we should just update the catalog_uuid_correlates_catalogs_with_reports.rb test to handle both the presence or absence of surrounding single quotes the same. This should enable the test to pass consistently when run with a Puppet Server master running JRuby 9k under Ruby language version 2.3.2+.

        Attachments

          Activity

            People

            Assignee:
            jeremy.barlow Jeremy Barlow
            Reporter:
            jeremy.barlow Jeremy Barlow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support