Browse Source
Add TestCluster interface to run Go tests against Rust volume server
Add TestCluster interface to run Go tests against Rust volume server
- Add TestCluster interface in framework/cluster_interface.go - Add StartVolumeCluster() factory that selects Go or Rust volume server based on VOLUME_SERVER_IMPL env var - Update all grpc/ and http/ test files to use StartVolumeCluster() instead of StartSingleVolumeCluster(), enabling the same test suite to run against either implementationrust-volume-server
29 changed files with 149 additions and 115 deletions
-
34test/volume_server/framework/cluster_interface.go
-
18test/volume_server/grpc/admin_extra_test.go
-
10test/volume_server/grpc/admin_lifecycle_test.go
-
8test/volume_server/grpc/admin_readonly_collection_test.go
-
8test/volume_server/grpc/batch_delete_test.go
-
14test/volume_server/grpc/copy_receive_variants_test.go
-
6test/volume_server/grpc/copy_sync_test.go
-
6test/volume_server/grpc/data_rw_test.go
-
6test/volume_server/grpc/data_stream_success_test.go
-
18test/volume_server/grpc/erasure_coding_test.go
-
4test/volume_server/grpc/health_state_test.go
-
16test/volume_server/grpc/scrub_query_test.go
-
8test/volume_server/grpc/tail_test.go
-
10test/volume_server/grpc/tiering_remote_test.go
-
4test/volume_server/grpc/vacuum_test.go
-
8test/volume_server/http/admin_test.go
-
14test/volume_server/http/auth_test.go
-
6test/volume_server/http/chunk_manifest_test.go
-
2test/volume_server/http/compressed_read_test.go
-
6test/volume_server/http/headers_static_test.go
-
2test/volume_server/http/image_transform_test.go
-
12test/volume_server/http/public_cors_methods_test.go
-
4test/volume_server/http/range_variants_test.go
-
2test/volume_server/http/read_deleted_test.go
-
8test/volume_server/http/read_path_variants_test.go
-
4test/volume_server/http/read_write_delete_test.go
-
18test/volume_server/http/throttling_test.go
-
4test/volume_server/http/write_delete_variants_test.go
-
4test/volume_server/http/write_error_variants_test.go
@ -0,0 +1,34 @@ |
|||||
|
package framework |
||||
|
|
||||
|
import ( |
||||
|
"os" |
||||
|
"testing" |
||||
|
|
||||
|
"github.com/seaweedfs/seaweedfs/test/volume_server/matrix" |
||||
|
) |
||||
|
|
||||
|
// TestCluster is the common interface for single-volume cluster harnesses.
|
||||
|
// Both *Cluster (Go volume) and *RustCluster (Rust volume) satisfy it.
|
||||
|
type TestCluster interface { |
||||
|
MasterAddress() string |
||||
|
VolumeAdminAddress() string |
||||
|
VolumePublicAddress() string |
||||
|
VolumeGRPCAddress() string |
||||
|
VolumeServerAddress() string |
||||
|
MasterURL() string |
||||
|
VolumeAdminURL() string |
||||
|
VolumePublicURL() string |
||||
|
BaseDir() string |
||||
|
Stop() |
||||
|
} |
||||
|
|
||||
|
// StartVolumeCluster starts a single-volume cluster using either the Go or
|
||||
|
// Rust volume server, depending on the VOLUME_SERVER_IMPL environment variable.
|
||||
|
// Set VOLUME_SERVER_IMPL=rust to use the Rust volume server.
|
||||
|
func StartVolumeCluster(t testing.TB, profile matrix.Profile) TestCluster { |
||||
|
t.Helper() |
||||
|
if os.Getenv("VOLUME_SERVER_IMPL") == "rust" { |
||||
|
return StartRustVolumeCluster(t, profile) |
||||
|
} |
||||
|
return StartSingleVolumeCluster(t, profile) |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue