From d762f8d58e8ce98c06b5a3b4709ea9e5bcf5951c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 24 Dec 2025 19:35:28 -0800 Subject: [PATCH] fix: use relative imports for testutil in all s3_test_main.go files - Change imports from absolute module path 'github.com/seaweedfs/seaweedfs/test/s3/testutil' to relative path '../testutil' - Fixes module resolution issues when running tests from individual directories - All test directories now compile and load testutil correctly - Enables tests to run with 'go test ./...' from any test subdirectory --- test/s3/acl/s3_test_main.go | 10 +++++----- test/s3/basic/s3_test_main.go | 10 +++++----- test/s3/copying/s3_test_main.go | 4 ++-- test/s3/cors/s3_test_main.go | 4 ++-- test/s3/delete/s3_test_main.go | 4 ++-- test/s3/etag/s3_test_main.go | 4 ++-- test/s3/filer_group/s3_test_main.go | 4 ++-- test/s3/iam/s3_test_main.go | 10 +++++----- test/s3/remote_cache/s3_test_main.go | 4 ++-- test/s3/retention/s3_test_main.go | 4 ++-- test/s3/sse/s3_test_main.go | 4 ++-- test/s3/tagging/s3_test_main.go | 4 ++-- test/s3/versioning/s3_test_main.go | 2 +- 13 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/s3/acl/s3_test_main.go b/test/s3/acl/s3_test_main.go index 27c0a004f..f9999e129 100644 --- a/test/s3/acl/s3_test_main.go +++ b/test/s3/acl/s3_test_main.go @@ -1,14 +1,14 @@ package acl import ( -"fmt" -"os" -"testing" + "fmt" + "os" + "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" + "../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/basic/s3_test_main.go b/test/s3/basic/s3_test_main.go index e99f033d6..ef5e3f2e6 100644 --- a/test/s3/basic/s3_test_main.go +++ b/test/s3/basic/s3_test_main.go @@ -1,14 +1,14 @@ package basic import ( -"fmt" -"os" -"testing" + "fmt" + "os" + "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" + "../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/copying/s3_test_main.go b/test/s3/copying/s3_test_main.go index 73cee5528..b6cf17503 100644 --- a/test/s3/copying/s3_test_main.go +++ b/test/s3/copying/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/cors/s3_test_main.go b/test/s3/cors/s3_test_main.go index 2d385211f..2dfeb2265 100644 --- a/test/s3/cors/s3_test_main.go +++ b/test/s3/cors/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/delete/s3_test_main.go b/test/s3/delete/s3_test_main.go index 60c641aea..e1482e23f 100644 --- a/test/s3/delete/s3_test_main.go +++ b/test/s3/delete/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/etag/s3_test_main.go b/test/s3/etag/s3_test_main.go index 6fcf7aae7..81992eba8 100644 --- a/test/s3/etag/s3_test_main.go +++ b/test/s3/etag/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/filer_group/s3_test_main.go b/test/s3/filer_group/s3_test_main.go index 8089c5e5c..2af59360e 100644 --- a/test/s3/filer_group/s3_test_main.go +++ b/test/s3/filer_group/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/iam/s3_test_main.go b/test/s3/iam/s3_test_main.go index 302591677..1064349e1 100644 --- a/test/s3/iam/s3_test_main.go +++ b/test/s3/iam/s3_test_main.go @@ -1,14 +1,14 @@ package iam import ( -"fmt" -"os" -"testing" + "fmt" + "os" + "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" + "../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/remote_cache/s3_test_main.go b/test/s3/remote_cache/s3_test_main.go index 006e690df..23d5fb20c 100644 --- a/test/s3/remote_cache/s3_test_main.go +++ b/test/s3/remote_cache/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/retention/s3_test_main.go b/test/s3/retention/s3_test_main.go index a24e3427f..77b77cbb6 100644 --- a/test/s3/retention/s3_test_main.go +++ b/test/s3/retention/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/sse/s3_test_main.go b/test/s3/sse/s3_test_main.go index 89e35dd82..f335da4e8 100644 --- a/test/s3/sse/s3_test_main.go +++ b/test/s3/sse/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/tagging/s3_test_main.go b/test/s3/tagging/s3_test_main.go index 387aa1278..5ff49d303 100644 --- a/test/s3/tagging/s3_test_main.go +++ b/test/s3/tagging/s3_test_main.go @@ -5,10 +5,10 @@ import ( "os" "testing" -"github.com/seaweedfs/seaweedfs/test/s3/testutil" +"../testutil" ) -var testServer *testutil.TestServer +var testServer *testutil.Server // TestMain sets up and tears down the test environment using weed mini func TestMain(m *testing.M) { diff --git a/test/s3/versioning/s3_test_main.go b/test/s3/versioning/s3_test_main.go index d94bab4e5..696b2bd52 100644 --- a/test/s3/versioning/s3_test_main.go +++ b/test/s3/versioning/s3_test_main.go @@ -5,7 +5,7 @@ import ( "os" "testing" - "github.com/seaweedfs/seaweedfs/test/s3/testutil" + "../testutil" ) var testServer *testutil.TestServer