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

Update catalog_uuid acceptance test for Ruby yaml serialization changes



    • Task
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 5.0.0
    • None
    • None
    • Systems Engineering
    • 1
    • Server 2017-06-14
    • Not Needed
    • Needs Assessment


      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, 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+.




            jeremy.barlow Jeremy Barlow
            jeremy.barlow Jeremy Barlow
            0 Vote for this issue
            2 Start watching this issue



              Zendesk Support