Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug output is unable to print command names #1015

Open
aieri opened this issue Jan 24, 2025 · 0 comments
Open

Debug output is unable to print command names #1015

aieri opened this issue Jan 24, 2025 · 0 comments
Labels

Comments

@aieri
Copy link

aieri commented Jan 24, 2025

Describe the bug
When invoking debug logging for command checks I would expect the output to include the check name and resemble what was shown in #816 (comment).
In place of the check name I see %!s(<nil>) instead.

How To Reproduce

Given a goss.yaml as follows:

command:
  foo:
    exec: echo "this is a test"
    exit-status: 0

Expected Behavior

$ goss -l debug v
2025-01-24T20:54:31Z [DEBUG] Setting log level to DEBUG
2025-01-24T20:54:31Z [DEBUG][Command][foo][stdout]  this is a test
2025-01-24T20:54:31Z [DEBUG][Command][foo][stdout]  
.

Total Duration: 0.002s
Count: 1, Failed: 0, Skipped: 0
2025-01-24T20:54:31Z [DEBUG] OK SUMMARY: Total Duration: 0.002s Count: 1, Failed: 0, Skipped: 0 

Actual Behavior

$ goss -l debug v
2025-01-24T20:56:04Z [DEBUG] Setting log level to DEBUG
2025-01-24T20:56:04Z [DEBUG][Command][%!s(<nil>)][stdout]  this is a test
2025-01-24T20:56:04Z [DEBUG][Command][%!s(<nil>)][stdout]  
.

Total Duration: 0.002s
Count: 1, Failed: 0, Skipped: 0
2025-01-24T20:56:04Z [DEBUG] OK SUMMARY: Total Duration: 0.002s Count: 1, Failed: 0, Skipped: 0 

Environment:

  • Version of goss: goss version v0.4.9
  • OS/Distribution version (if applicable): Ubuntu 24.04.1 LTS
@aieri aieri added the bug label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant