-
Notifications
You must be signed in to change notification settings - Fork 23
smoke: colorize output #358
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
Conversation
Set stdout and stderr to line buffered mode to ensure output is flushed after each newline. This is needed when output is piped through awk for colorization, as block buffering would delay output until the buffer fills, making the smoke tests appear to hang. Signed-off-by: Robin Jarry <rjarry@redhat.com>
Keep stderr for actual errors. Signed-off-by: Robin Jarry <rjarry@redhat.com>
When stdout is a TTY, colorize different output streams to improve readability during test execution: - Bash xtrace (set -x) in cyan - grout daemon logs in blue - grout daemon errors in bold red - grcli events in yellow - FRR zebra logs in magenta Each stream is piped through awk to apply ANSI color codes. Signed-off-by: Robin Jarry <rjarry@redhat.com>
Replace the bash-specific SRANDOM variable with /dev/urandom for generating random test run identifiers. Reading from /dev/urandom provides better randomness than SRANDOM and shortens the line. Add || : to prevent pipeline failures from terminating the test script when head closes the pipe early after reading one line. Signed-off-by: Robin Jarry <rjarry@redhat.com>
📝 WalkthroughWalkthroughThis pull request modifies I/O handling and output formatting across the codebase. Changes include explicit line-buffered I/O initialization for stdout and stderr in the CLI main function with error handling, redirection of log output from stderr to stdout in the DPDK logging module, and introduction of tty-aware colorized logging and tracing in the shell test initialization script. The shell script updates conditionally apply color formatting to various subsystem outputs when stdout is a terminal. Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (2)**/*.{c,h}⚙️ CodeRabbit configuration file
Files:
**/*.sh⚙️ CodeRabbit configuration file
Files:
🪛 Shellcheck (0.11.0)smoke/_init.sh[warning] 104-104: run_id appears unused. Verify use (or export if used externally). (SC2034) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🔇 Additional comments (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Tested-by: Anthony Harivel aharivel@redhat.com |
aharivel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - It's good to see the life in color !
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores