Skip to content

Commit f0d3d29

Browse files
committed
ref: volume migration tests
1 parent 52f1c90 commit f0d3d29

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
source _unit-test/_test_setup.sh
4+
source install/dc-detect-version.sh
5+
source install/create-docker-volumes.sh
6+
7+
# Generate some random files on `sentry-vroom` volume for testing
8+
$dc run --rm --no-deps -v sentry-vroom:/var/vroom/sentry-profiles busybox sh -c '
9+
for i in $(seq 1 1000); do
10+
echo "This is test file $i" > /var/vroom/sentry-profiles/test_file_$i.txt
11+
done
12+
'
13+
14+
# Set the flag to apply automatic updates
15+
export APPLY_AUTOMATIC_CONFIG_UPDATES=1
16+
17+
# Here we're just gonna test to run it multiple times
18+
# Only to make sure it doesn't break
19+
for i in $(seq 1 5); do
20+
source install/bootstrap-s3-vroom.sh
21+
done
22+
23+
# Ensure that the files have been migrated to SeaweedFS
24+
migrated_files_count=$($dc run --rm --no-deps seaweedfs sh -c '
25+
apk add --no-cache s3cmd &&
26+
s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket="localhost:8333/%(bucket)" ls s3://profiles/ | wc -l
27+
')
28+
if [[ "$migrated_files_count" -ne 1000 ]]; then
29+
echo "Error: Expected 1000 migrated files, but found $migrated_files_count"
30+
exit 1
31+
fi
32+
33+
report_success

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ services:
753753
SENTRY_KAFKA_BROKERS_PROFILING: "kafka:9092"
754754
SENTRY_KAFKA_BROKERS_OCCURRENCES: "kafka:9092"
755755
SENTRY_BUCKET_PROFILES: "s3://profiles?region=us-east-1&endpoint=seaweedfs:8333&s3ForcePathStyle=true&disableSSL=true"
756+
AWS_ACCESS_KEY: "sentry"
757+
AWS_SECRET_KEY: "sentry"
756758
SENTRY_SNUBA_HOST: "http://snuba-api:1218"
757759
volumes:
758760
- sentry-vroom:/var/vroom/sentry-profiles

0 commit comments

Comments
 (0)