From f69b1048383efd506e91cf9963b9221e67125d02 Mon Sep 17 00:00:00 2001 From: peusebiu Date: Mon, 9 Jan 2023 19:04:56 +0200 Subject: [PATCH] fix(test): use correct aws region for dynamodb (#1093) Signed-off-by: Petu Eusebiu --- .github/workflows/ci-cd.yml | 4 ++-- pkg/storage/s3/s3_test.go | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 94a085a0..01ad65b6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -72,8 +72,8 @@ jobs: - if: matrix.os == 'linux' && matrix.arch == 'amd64' name: Setup localstack service run: | - pip install localstack # install LocalStack cli - docker pull localstack/localstack # Make sure to pull the latest version of the image + pip install localstack # Install LocalStack cli + docker pull localstack/localstack:1.3 # Make sure to pull the latest version of the image localstack start -d # Start LocalStack in the background echo "Waiting for LocalStack startup..." # Wait 30 seconds for the LocalStack container diff --git a/pkg/storage/s3/s3_test.go b/pkg/storage/s3/s3_test.go index c1a14850..afb12eea 100644 --- a/pkg/storage/s3/s3_test.go +++ b/pkg/storage/s3/s3_test.go @@ -45,6 +45,7 @@ var ( errorText = "new s3 error" errS3 = errors.New(errorText) zotStorageTest = "zot-storage-test" + s3Region = "us-east-2" ) func cleanupStorage(store driver.StorageDriver, name string) { @@ -94,7 +95,7 @@ func createObjectsStore(rootDir string, cacheDir string, dedupe bool) ( storageDriverParams := map[string]interface{}{ "rootDir": rootDir, "name": "s3", - "region": "us-east-2", + "region": s3Region, "bucket": bucket, "regionendpoint": endpoint, "accesskey": "minioadmin", @@ -145,7 +146,7 @@ func createObjectsStoreDynamo(rootDir string, cacheDir string, dedupe bool, tabl storageDriverParams := map[string]interface{}{ "rootDir": rootDir, "name": "s3", - "region": "us-east-2", + "region": s3Region, "bucket": bucket, "regionendpoint": endpoint, "accesskey": "minioadmin", @@ -176,7 +177,7 @@ func createObjectsStoreDynamo(rootDir string, cacheDir string, dedupe bool, tabl cacheDriver, _ = storage.Create("dynamodb", cache.DynamoDBDriverParameters{ Endpoint: os.Getenv("DYNAMODBMOCK_ENDPOINT"), - Region: os.Getenv("us-east-2"), + Region: s3Region, TableName: tableName, }, log) @@ -688,7 +689,7 @@ func TestNegativeCasesObjectsStorage(t *testing.T) { StorageDriver: map[string]interface{}{ "rootDir": "/a", "name": "s3", - "region": "us-east-2", + "region": s3Region, "bucket": bucket, "regionendpoint": endpoint, "accesskey": "minioadmin",