From 5d614bc25541476999484db791ab4cfb07dd53be Mon Sep 17 00:00:00 2001 From: shichangkuo Date: Fri, 29 Mar 2024 16:09:18 +0800 Subject: [PATCH] fix: add pre-check for obs testing (#106) --- post-processor/huaweicloud-import/obs-util_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/post-processor/huaweicloud-import/obs-util_test.go b/post-processor/huaweicloud-import/obs-util_test.go index 1a41254..9991adc 100644 --- a/post-processor/huaweicloud-import/obs-util_test.go +++ b/post-processor/huaweicloud-import/obs-util_test.go @@ -12,6 +12,11 @@ func TestUploadFileToObject(t *testing.T) { region := os.Getenv("HW_REGION_NAME") ak := os.Getenv("HW_ACCESS_KEY") sk := os.Getenv("HW_SECRET_KEY") + + if region == "" || ak == "" || sk == "" { + t.Skip("Skipping test because it requires some environment variables") + } + obsEndpoint := fmt.Sprintf("https://obs.%s.myhuaweicloud.com", region) envProxyConfigure := obs.WithProxyFromEnv(true)