Skip to content

Commit f0c23cb

Browse files
authored
ci: test against rustfs (#35)
1 parent 9008ffc commit f0c23cb

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
- UpCloud
5151
- Minio
5252
- moto
53+
- RustFS
5354
cli:
5455
- terraform
5556
- tofu
@@ -117,3 +118,17 @@ jobs:
117118
go test -v -cover ./internal/provider/
118119
timeout-minutes: 10
119120
if: matrix.target == 'moto'
121+
- name: Test against RustFS
122+
env:
123+
TF_ACC: "1"
124+
TEST_TARGET: RustFS
125+
OBJSTO_ACCESS_KEY: access_key
126+
OBJSTO_SECRET_KEY: secret_key
127+
OBJSTO_ENDPOINT: http://localhost:9000
128+
OBJSTO_REGION: local-1
129+
run: |
130+
docker run -d -e RUSTFS_ACCESS_KEY=access_key -e RUSTFS_SECRET_KEY=secret_key -p 9000:9000 rustfs/rustfs:1.0.0-alpha.83 /data
131+
132+
go test -v -cover ./internal/provider/
133+
timeout-minutes: 10
134+
if: matrix.target == 'RustFS'

internal/provider/bucket_cors_configuration_test.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,22 @@ func checkCORSHeaders(name, key, origin string, expectedHeaders map[string]strin
5353
}
5454
}
5555

56-
func testTargetIs(target string) bool {
57-
return strings.EqualFold(os.Getenv("TEST_TARGET"), target)
56+
func testTarget() string {
57+
return os.Getenv("TEST_TARGET")
58+
}
59+
60+
func testTargetIs(target ...string) bool {
61+
for _, t := range target {
62+
if strings.EqualFold(testTarget(), t) {
63+
return true
64+
}
65+
}
66+
return false
5867
}
5968

6069
func TestAccBucketCORSConfigurationResource(t *testing.T) {
61-
if testTargetIs("Minio") {
62-
t.Skip("Skipping CORS configuration tests because target object storage is Minio which does not support configuring CORS settings for buckets.")
70+
if testTargetIs("Minio", "RustFS") {
71+
t.Skipf("Skipping CORS configuration tests because target object storage is %s which does not support configuring CORS settings for buckets.", testTarget())
6372
}
6473

6574
bucket_name := withSuffix("bucket-cors-configuration")

0 commit comments

Comments
 (0)