Skip to content

Commit

Permalink
test: add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Jul 15, 2024
1 parent fe1a8f3 commit 679f8e6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmd/serve/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,29 @@ func TestListBucketsAuthProxy(t *testing.T) {

testListBuckets(t, cases, true)
}

// TestS3Integration runs the s3 server then runs the unit tests for the
// s3 remote against it.
func TestS3Integration(t *testing.T) {
// Configure and start the server
start := func(f fs.Fs) (configmap.Simple, func()) {
testURL, keyid, keysec, w := serveS3(f)

// Config for the backend we'll use to connect to the server
config := configmap.Simple{
"type": "s3",
"provider": "Rclone",
"endpoint": testURL,
"access_key_id": keyid,
"secret_access_key": keysec,
}

// return a stop function
return config, func() {
assert.NoError(t, w.server.Shutdown())
w.server.Wait()
}
}

servetest.Run(t, "s3", start)
}

0 comments on commit 679f8e6

Please sign in to comment.