-
Couldn't load subscription status.
- Fork 1
PBM. Add PBM CLI validation #424
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
base: main
Are you sure you want to change the base?
Conversation
6d90658 to
775af4b
Compare
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.
Pull Request Overview
This PR adds comprehensive CLI validation tests for the PBM (Percona Backup for MongoDB) tool. The changes introduce a new test file that validates various PBM command-line interface commands and their error handling.
- Adds CLI validation tests for all major PBM commands (backup, restore, config, list, etc.)
- Implements Docker-based test environment setup with MongoDB replica set initialization
- Tests both valid and invalid parameter combinations with proper error message validation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| result = n.run("pbm delete-backup -y --older-than=2025-01-01") | ||
| try: | ||
| assert result.rc == 0, "Delete-backup with --older-than should fail" |
Copilot
AI
Sep 8, 2025
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.
The assertion message says the command 'should fail' but the assertion checks for success (rc == 0). This is contradictory and indicates either the assertion or the message is incorrect.
| assert result.rc == 0, "Delete-backup with --older-than should fail" | |
| assert result.rc != 0, "Delete-backup with --older-than should fail" |
| result = n.run("pbm restore") | ||
| try: | ||
| assert result.rc != 0, "Restore without arguments should fail" | ||
| assert "specify a backup name, --time, or --external" in result.stderr |
Copilot
AI
Sep 8, 2025
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.
This assertion checks for an exact error message string without using .lower() like other similar assertions in the file. For consistency and robustness, consider using .lower() to make the check case-insensitive.
| assert "specify a backup name, --time, or --external" in result.stderr | |
| assert "specify a backup name, --time, or --external" in result.stderr.lower() |
775af4b to
33c5fb7
Compare
No description provided.