PBM. Add PBM CLI validation#424
Conversation
6d90658 to
775af4b
Compare
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.