Browse Source

Normalize TestMain filenames: ensure s3_test_main_test.go used across S3 tests

feature/modernize-s3-tests
Chris Lu 2 months ago
parent
commit
754fae92ec
  1. 0
      test/s3/acl/s3_test_main_test.go
  2. 51
      test/s3/basic/s3_test_main.go
  3. 0
      test/s3/copying/s3_test_main_test.go
  4. 0
      test/s3/cors/s3_test_main_test.go
  5. 0
      test/s3/delete/s3_test_main_test.go
  6. 0
      test/s3/etag/s3_test_main_test.go
  7. 0
      test/s3/filer_group/s3_test_main_test.go
  8. 0
      test/s3/iam/s3_test_main_test.go
  9. 0
      test/s3/remote_cache/s3_test_main_test.go
  10. 0
      test/s3/retention/s3_test_main_test.go
  11. 0
      test/s3/tagging/s3_test_main_test.go
  12. 0
      test/s3/versioning/s3_test_main_test.go

0
test/s3/acl/s3_test_main.go → test/s3/acl/s3_test_main_test.go

51
test/s3/basic/s3_test_main.go

@ -1,51 +0,0 @@
package basic
import (
"fmt"
"os"
"strings"
"testing"
"github.com/seaweedfs/seaweedfs/test/s3/testutil"
)
var testServer *testutil.TestServer
// TestMain sets up and tears down the test environment using weed mini
func TestMain(m *testing.M) {
var exitCode int
fmt.Println("TestMain: Starting test setup...")
// Check if we should manage the server or use an existing one
if os.Getenv("USE_EXTERNAL_SERVER") != "true" {
// Start server using weed mini
fmt.Println("TestMain: Starting weed mini server...")
config := testutil.DefaultServerConfig(nil)
config.AccessKey = "some_access_key1"
config.SecretKey = "some_secret_key1"
fmt.Println("TestMain: Setting environment variables...")
// Set AWS credentials for tests
os.Setenv("AWS_ACCESS_KEY_ID", config.AccessKey)
os.Setenv("AWS_SECRET_ACCESS_KEY", config.SecretKey)
os.Setenv("AWS_REGION", "us-east-1")
fmt.Printf("TestMain: Set AWS_ACCESS_KEY_ID=%s, AWS_SECRET_ACCESS_KEY=%s, AWS_REGION=us-east-1\n",
config.AccessKey, strings.Repeat("*", len(config.SecretKey)))
var err error
testServer, err = testutil.StartServer(config)
if err != nil {
fmt.Printf("TestMain: ERROR - Failed to start test server: %v\n", err)
os.Exit(1)
}
fmt.Println("TestMain: Server started successfully")
defer testServer.Stop()
}
// Run tests
fmt.Println("TestMain: Running tests...")
exitCode = m.Run()
fmt.Printf("TestMain: Tests completed with exit code %d\n", exitCode)
os.Exit(exitCode)
}

0
test/s3/copying/s3_test_main.go → test/s3/copying/s3_test_main_test.go

0
test/s3/cors/s3_test_main.go → test/s3/cors/s3_test_main_test.go

0
test/s3/delete/s3_test_main.go → test/s3/delete/s3_test_main_test.go

0
test/s3/etag/s3_test_main.go → test/s3/etag/s3_test_main_test.go

0
test/s3/filer_group/s3_test_main.go → test/s3/filer_group/s3_test_main_test.go

0
test/s3/iam/s3_test_main.go → test/s3/iam/s3_test_main_test.go

0
test/s3/remote_cache/s3_test_main.go → test/s3/remote_cache/s3_test_main_test.go

0
test/s3/retention/s3_test_main.go → test/s3/retention/s3_test_main_test.go

0
test/s3/tagging/s3_test_main.go → test/s3/tagging/s3_test_main_test.go

0
test/s3/versioning/s3_test_main.go → test/s3/versioning/s3_test_main_test.go

Loading…
Cancel
Save