Skip to content

🐛 Fix: Make blackbox exit with code 1 when database backups fail#173

Merged
lemonsaurus merged 2 commits intomainfrom
fix/database-failure-exit-code
Jul 28, 2025
Merged

🐛 Fix: Make blackbox exit with code 1 when database backups fail#173
lemonsaurus merged 2 commits intomainfrom
fix/database-failure-exit-code

Conversation

@lemonsaurus
Copy link
Owner

Summary

Changes

  • blackbox/cli.py: Add success = False when database backup fails
  • tests/test_cli_exit_codes.py: New test suite covering all exit code scenarios

Test Coverage

  • ✅ Successful backups return exit code 0
  • ✅ Database failures return exit code 1
  • ✅ Storage failures return exit code 1
  • ✅ Mixed scenarios with partial failures

Impact

This change enables proper monitoring and alerting when database backups fail, which is essential for production environments and automated workflows.

Fixes #156

Ensures the CLI returns proper exit code when any database backup fails
by setting success = False before continuing to next database.
Add test suite for CLI exit code behavior to validate that database
and storage failures properly return False from run(), ensuring
exit code 1 is returned to indicate failure.

Tests cover:
- Successful backups return True
- Database failures return False
- Storage failures return False
- Mixed success/failure scenarios
@lemonsaurus lemonsaurus merged commit 59e62a0 into main Jul 28, 2025
1 check passed
@lemonsaurus lemonsaurus deleted the fix/database-failure-exit-code branch July 28, 2025 10:55
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.

Blackbox does not exit with status code 1 when a database has failed

1 participant