Skip to content

🧪 [testing improvement] implement unit tests for logging and exit behavior#4

Open
palindsay wants to merge 1 commit intomainfrom
testing-improvement-die-function-12443805790410432496
Open

🧪 [testing improvement] implement unit tests for logging and exit behavior#4
palindsay wants to merge 1 commit intomainfrom
testing-improvement-die-function-12443805790410432496

Conversation

@palindsay
Copy link
Copy Markdown
Owner

🎯 What: The testing gap for the die function (exit code and stderr output) and other logging helpers was addressed.
📊 Coverage: Scenarios for info, warn, error, and die are now tested, including:

  • Correct exit code (1) for die.
  • Correct output streams (stdout vs stderr).
  • Correct ANSI-colored prefixes ([INFO], [WARN], [ERROR]).
    Result: Significant improvement in test coverage for script utilities, providing a foundation for future automated testing.

PR created automatically by Jules for task 12443805790410432496 started by @palindsay

Refactor setup-llamacpp-cuda-dgx-spark.sh to wrap execution logic in
a main() function and add a sourcing guard. This enables the script
to be sourced without executing its main body.

Create tests/test_logging.sh which sources the script and defines
test cases for info(), warn(), error(), and die() functions.
Specifically, verify that:
- info() and warn() print correctly to stdout.
- error() and die() print correctly to stderr.
- die() exits with status code 1.
- All logging functions include the expected ANSI color codes.

This addresses the untested exit behavior in the 'die' function.

Co-authored-by: palindsay <2763669+palindsay@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant