- Notifications
You must be signed in to change notification settings - Fork35
Abs backup path#108
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Abs backup path#108
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -43,7 +43,13 @@ class FSTestBackupDir(TestBackupDir): | |||
""" Backup directory. Usually created by running pg_probackup init -B <path>""" | |||
def __init__(self, *, rel_path, backup): | |||
self.path = os.path.join(init_params.tmp_path, rel_path, backup) | |||
backup_prefix = os.environ.get('PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX') |
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.
Получение параметров окружения нужно делать в init_helpers.py, иначе будет дубликация кода - в s3_backup.py тоже нужно будет добавить.
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.
Для S3 я планирую перенести присвоение self.path в базовый класс, чтобы сделать пути в S3 и не в S3 одинаковыми. Но это требует предварительной проверки и будет делаться в рамках отдельногно PR.
if not os.path.isabs(backup_prefix): | ||
raise Exception(f"PG_PROBACKUP_TEST_BACKUP_DIR_PREFIX must be an absolute path, current value: {backup_prefix}") | ||
self.path = os.path.join(backup_prefix, rel_path, backup) | ||
else: |
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.
self.path = os.path.join(backup_prefix or init_params.tmp_path, rel_path, backup)
demonolock commentedFeb 1, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
В def tearDown(self): в basic_test.py нужно добавить очистку self.backup_dir.cleanup() И, по-хорошему, проверить тот тест |
No description provided.