Skip to content

Commit

Permalink
test(gcs): add integration test for custom endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
sanadhis committed Feb 19, 2024
1 parent 3e91625 commit 6cb573d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
18 changes: 18 additions & 0 deletions test/integration/config-gcs-custom-endpoint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
general:
disable_progress_bar: true
remote_storage: gcs
upload_concurrency: 4
download_concurrency: 4
restore_schema_on_cluster: "{cluster}"
clickhouse:
host: clickhouse
port: 9000
restart_command: bash -c 'echo "FAKE RESTART"'
gcs:
bucket: altinity-qa-test
path: backup/{cluster}/{shard}
object_disk_path: object_disks/{cluster}/{shard}
credentials_file: /etc/clickhouse-backup/credentials.json
compression_format: tar
endpoint: http://gcs:8080/storage/v1/
# endpoint: http://gcs:8080/storage/v1/
22 changes: 11 additions & 11 deletions test/integration/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ services:
- clickhouse-backup

# todo need to reproduce download after upload
# gcs:
# image: fsouza/fake-gcs-server:latest
# hostname: gcs
# entrypoint:
# - /bin/sh
# command:
# - -c
# - "mkdir -p /data/clickhouse-backup-test-gcs && fake-gcs-server -data /data -scheme http -port 8080 -public-host gsc:8080"
# networks:
# - clickhouse-backup

gcs:
image: fsouza/fake-gcs-server:latest
hostname: gcs
entrypoint:
- /bin/sh
command:
- -c
- "mkdir -p /data/clickhouse-backup-test-gcs && fake-gcs-server -data /data/clickhouse-backup-test-gcs -scheme http -port 8080 -public-host gcs:8080"
networks:
- clickhouse-backup

azure:
image: mcr.microsoft.com/azure-storage/azurite:latest
Expand Down Expand Up @@ -196,6 +195,7 @@ services:
- ./config-ftp.yaml:/etc/clickhouse-backup/config-ftp.yaml
- ./config-ftp-old.yaml:/etc/clickhouse-backup/config-ftp-old.yaml
- ./config-gcs.yml:/etc/clickhouse-backup/config-gcs.yml
- ./config-gcs-custom-endpoint.yml:/etc/clickhouse-backup/config-gcs-custom-endpoint.yml
- ./config-s3.yml:/etc/clickhouse-backup/config-s3.yml
- ./config-s3-embedded.yml:/etc/clickhouse-backup/config-s3-embedded.yml
- ./config-s3-fips.yml:/etc/clickhouse-backup/config-s3-fips.yml.template
Expand Down
13 changes: 10 additions & 3 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,15 @@ func TestIntegrationGCS(t *testing.T) {
runMainIntegrationScenario(t, "GCS", "config-gcs.yml")
}

func TestIntegrationGCSCustomeEndpoint(t *testing.T) {
if isTestShouldSkip("GCS_TESTS") {
t.Skip("Skipping GCS integration tests...")
return
}
//t.Parallel()
runMainIntegrationScenario(t, "GCS", "config-gcs-custom-endpoint.yml")
}

func TestIntegrationSFTPAuthPassword(t *testing.T) {
//t.Parallel()
runMainIntegrationScenario(t, "SFTP", "config-sftp-auth-password.yaml")
Expand Down Expand Up @@ -2110,7 +2119,6 @@ func checkObjectStorageIsEmpty(t *testing.T, r *require.Assertions, remoteStorag
}
if remoteStorageType == "SFTP" {
checkRemoteDir("total 0", "sshd", "bash", "-c", "ls -lh /root/")

}
if remoteStorageType == "FTP" {
if strings.Contains(os.Getenv("COMPOSE_FILE"), "advanced") {
Expand All @@ -2119,9 +2127,8 @@ func checkObjectStorageIsEmpty(t *testing.T, r *require.Assertions, remoteStorag
checkRemoteDir("total 0", "ftp", "bash", "-c", "ls -lh /home/vsftpd/test_backup/backup/")
}
}
//todo check gcs backup is empty
if remoteStorageType == "GCS" {

checkRemoteDir("total 0", "gcs", "bash", "-c", "ls -lh /data/clickhouse-backup-test-gcs")
}
}

Expand Down

0 comments on commit 6cb573d

Please sign in to comment.