Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
asavchkov merged 6 commits intomasterfromabs-backup-path
Feb 12, 2024
Merged

Abs backup path#108

asavchkov merged 6 commits intomasterfromabs-backup-path
Feb 12, 2024

Conversation

demonolock
Copy link
Contributor

No description provided.

@@ -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')
Copy link
ContributorAuthor

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 тоже нужно будет добавить.

Copy link
Contributor

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:
Copy link
ContributorAuthor

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
Copy link
ContributorAuthor

demonolock commentedFeb 1, 2024
edited
Loading

В def tearDown(self): в basic_test.py нужно добавить очистку self.backup_dir.cleanup()

И, по-хорошему, проверить тот тест

@asavchkovasavchkov merged commitbd37658 intomasterFeb 12, 2024
@asavchkovasavchkov deleted the abs-backup-path branchFebruary 12, 2024 14:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@asavchkovasavchkovasavchkov left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@demonolock@asavchkov@postgres-dev

[8]ページ先頭

©2009-2025 Movatter.jp