-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add backup/restore integration tests #2012
Add backup/restore integration tests #2012
Conversation
|
||
echo "${_group}Test that backup/restore works..." | ||
echo "Creating backup..." | ||
$dcr -v $(pwd)/sentry:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json |
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.
Probably need an ownership/permission set here. I suggest something like this:
mkdir $(pwd)/sentry/backup
chmod +w $(pwd)/sentry/backup
$dcr -v $(pwd)/sentry/backup:/sentry-data/backup --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json
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.
Darn looks like that isn't working, will play around and see if I can figure something out. Script seems to run fine locally though
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.
For some reason, write access for group + owner wasn't enough. I needed write access for all users
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.
Probably because the user and group IDs are different when running the sentry container (from the one GitHub actions bash script runner)
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.
Probably because the user and group IDs are different when running the sentry container (from the one GitHub actions bash script runner)
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.
ah that makes sense
59a795e
to
280bf73
Compare
438c722
to
239d815
Compare
@@ -25,3 +26,4 @@ echo "Testing in-place upgrade and customizations" | |||
./install.sh --minimize-downtime | |||
_integration-test/run.sh | |||
_integration-test/ensure-customizations-work.sh | |||
_integration-test/ensure-backup-restore-works.sh |
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.
A little goofy that we have to call this twice, but I guess that's where we're at and we clean up the test suite under getsentry/team-ospo#91.
source install/set-up-and-migrate-database.sh | ||
$dc up -d | ||
|
||
# echo "Importing backup..." |
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.
echo?
# to group and owner. Instead, try creating the empty file and then give everyone write access to the backup file | ||
touch $backup_path/backup.json | ||
chmod 666 $backup_path/backup.json | ||
$dcr -v $backup_path:/sentry-data/backup -T -e SENTRY_LOG_LEVEL=CRITICAL web export /sentry-data/backup/backup.json |
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.
Would love to see this match the docs exactly.
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.
With a comment saying as much.
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.
If you can't get it exactly like the docs that's fine, just say so in the comment.
$dc up -d | ||
|
||
# echo "Importing backup..." | ||
$dcr --rm -T web import /etc/sentry/backup/backup.json |
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 matches the docs basically. Fine to use $dcr I guess vs. writing it out (like in the docs) if $dcr is necessary to get the test infra to work.
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.
it's not necessary to get it to work, For this use case I can use the exact command the docs is using
90f2c7e
to
e886bb8
Compare
e886bb8
to
755653e
Compare
closes #1918
Since there is a unit test in sentry already covering backup/restore, this is a more broad test. It tests these functionalities
backup.json
file.