Skip to content

Commit a492aa9

Browse files
committed
(maint) Do not output raw serialization in acceptance
Previously, we would output the full content of an agent run using http_debug when checking serialization formats. We require checking the stdout of the http_debug command to validate the content-type header was set correctly. However, outputting the raw bytes from the http requests to the logs can be problematic because in CI we will take each test's output and place them into xml files for Jenkins to display. These raw bytes may contain invalid xml content that causes the post-run CI actions to fail the build. This sets the command which uses http_debug to "silent" so that its content will not be sent to stdout.
1 parent 24de536 commit a492aa9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

acceptance/tests/server_returns_pson_when_preferred_serialization_set.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
formats.each do |expected_format|
1111
step "Server returns #{expected_format} catalog when --preferred_serialization_format=#{expected_format}" do
1212
agents.each do |agent|
13+
# We use :silent here to avoid raw http_debug bytes being printed to our CI logs
1314
on(agent, puppet('agent', '-t',
1415
"--preferred_serialization_format #{expected_format}",
15-
'--http_debug'), :acceptable_exit_codes => [0,2]) do |res|
16+
'--http_debug'),
17+
:acceptable_exit_codes => [0,2], :silent => true) do |res|
1618
found_format = false
1719
started = false
1820
res.stderr.each_line do |line|

0 commit comments

Comments
 (0)