Project

General

Profile

Actions

Bug #37613

closed

Report renderer tests fail depending on the libyaml version

Added by Evgeni Golov 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Fixed in Releases:
Found in Releases:

Description

different libyaml versions encode nil slightly differently:

libyaml-0.1.7 (EL8):

irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> {"lol":nil}.to_yaml
=> "---\n:lol: \n" 

libyaml-0.2.5 (EL9):

irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> {"lol":nil}.to_yaml
=> "---\n:lol:\n" 

Both are valid documents and both are parsed fine back with both libyaml versions.

However, this breaks our tests:

Failure:
ReportScopeTest::#report_render#test_0005_render types [test/unit/foreman/renderer/scope/report_test.rb:107]
Minitest::Assertion: --- expected
+++ actual
@@ -7,5 +7,5 @@
   Number: 1
   Bool: false
   Empty: ''
-  Nil: 
+  Nil:
 " 

(if you look closely, the one line is "Nil: " and the other "Nil:")

Actions

Also available in: Atom PDF