Browse Source
refactor: add test-with-server targets to all S3 test directories
refactor: add test-with-server targets to all S3 test directories
- Add test-with-server target to acl, basic, delete, etag Makefiles - Simplify test-with-server to use TestMain-based server auto-management - Update tagging, cors, filer_group, retention, remote_cache, sse Makefiles - Add TEST_PATTERN support for CI/CD parameterized testing - Remove complex manual server management from test-with-server - All targets now delegate to TestMain for consistent, simplified server lifecycle - Backward compatible with existing make targets for manual testingfeature/modernize-s3-tests
13 changed files with 186 additions and 66 deletions
-
44test/s3/acl/Makefile
-
44test/s3/basic/Makefile
-
10test/s3/copying/Makefile
-
12test/s3/cors/Makefile
-
44test/s3/delete/Makefile
-
2test/s3/etag/Makefile
-
18test/s3/filer_group/Makefile
-
4test/s3/iam/Makefile
-
12test/s3/remote_cache/Makefile
-
14test/s3/retention/Makefile
-
31test/s3/sse/Makefile
-
12test/s3/tagging/Makefile
-
5test/s3/versioning/Makefile
@ -0,0 +1,44 @@ |
|||||
|
# Makefile for SeaweedFS S3 ACL tests
|
||||
|
# Tests auto-manage server via TestMain using weed mini
|
||||
|
|
||||
|
.PHONY: test test-quick test-external test-with-server clean check-deps build |
||||
|
|
||||
|
# Build SeaweedFS binary if not exists
|
||||
|
build: |
||||
|
@echo "Building SeaweedFS binary..." |
||||
|
@cd ../../../ && make build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
|
||||
|
# Check dependencies
|
||||
|
check-deps: build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
@echo "✅ Dependencies available" |
||||
|
|
||||
|
# Run all tests (auto-manages weed mini server via TestMain)
|
||||
|
test: check-deps |
||||
|
@echo "Running all S3 ACL tests..." |
||||
|
@go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run quick tests (uses TEST_PATTERN if provided)
|
||||
|
test-quick: check-deps |
||||
|
@echo "Running quick S3 ACL tests..." |
||||
|
@if [ -z "$(TEST_PATTERN)" ]; then \
|
||||
|
go test -v -timeout=10m ./...; \
|
||||
|
else \
|
||||
|
go test -v -timeout=10m -run "$(TEST_PATTERN)" ./...; \
|
||||
|
fi |
||||
|
|
||||
|
# Run tests against external server (CI/CD mode)
|
||||
|
test-external: check-deps |
||||
|
@echo "Running tests against external server (USE_EXTERNAL_SERVER=true)..." |
||||
|
@USE_EXTERNAL_SERVER=true go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run tests with auto-managed server (CI/CD target)
|
||||
|
test-with-server: test |
||||
|
|
||||
|
# Clean up test artifacts
|
||||
|
clean: |
||||
|
@echo "Cleaning up test artifacts..." |
||||
|
@rm -f *.log *.pid |
||||
|
@go clean -testcache |
||||
|
@echo "✅ Cleanup completed" |
||||
@ -0,0 +1,44 @@ |
|||||
|
# Makefile for SeaweedFS S3 Basic tests
|
||||
|
# Tests auto-manage server via TestMain using weed mini
|
||||
|
|
||||
|
.PHONY: test test-quick test-external test-with-server clean check-deps build |
||||
|
|
||||
|
# Build SeaweedFS binary if not exists
|
||||
|
build: |
||||
|
@echo "Building SeaweedFS binary..." |
||||
|
@cd ../../../ && make build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
|
||||
|
# Check dependencies
|
||||
|
check-deps: build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
@echo "✅ Dependencies available" |
||||
|
|
||||
|
# Run all tests (auto-manages weed mini server via TestMain)
|
||||
|
test: check-deps |
||||
|
@echo "Running all S3 basic tests..." |
||||
|
@go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run quick tests (uses TEST_PATTERN if provided)
|
||||
|
test-quick: check-deps |
||||
|
@echo "Running quick S3 basic tests..." |
||||
|
@if [ -z "$(TEST_PATTERN)" ]; then \
|
||||
|
go test -v -timeout=10m ./...; \
|
||||
|
else \
|
||||
|
go test -v -timeout=10m -run "$(TEST_PATTERN)" ./...; \
|
||||
|
fi |
||||
|
|
||||
|
# Run tests against external server (CI/CD mode)
|
||||
|
test-external: check-deps |
||||
|
@echo "Running tests against external server (USE_EXTERNAL_SERVER=true)..." |
||||
|
@USE_EXTERNAL_SERVER=true go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run tests with auto-managed server (CI/CD target)
|
||||
|
test-with-server: test |
||||
|
|
||||
|
# Clean up test artifacts
|
||||
|
clean: |
||||
|
@echo "Cleaning up test artifacts..." |
||||
|
@rm -f *.log *.pid |
||||
|
@go clean -testcache |
||||
|
@echo "✅ Cleanup completed" |
||||
@ -0,0 +1,44 @@ |
|||||
|
# Makefile for SeaweedFS S3 Delete tests
|
||||
|
# Tests auto-manage server via TestMain using weed mini
|
||||
|
|
||||
|
.PHONY: test test-quick test-external test-with-server clean check-deps build |
||||
|
|
||||
|
# Build SeaweedFS binary if not exists
|
||||
|
build: |
||||
|
@echo "Building SeaweedFS binary..." |
||||
|
@cd ../../../ && make build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
|
||||
|
# Check dependencies
|
||||
|
check-deps: build |
||||
|
@test -f ../../../weed || (echo "SeaweedFS binary not found" && exit 1) |
||||
|
@echo "✅ Dependencies available" |
||||
|
|
||||
|
# Run all tests (auto-manages weed mini server via TestMain)
|
||||
|
test: check-deps |
||||
|
@echo "Running all S3 delete tests..." |
||||
|
@go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run quick tests (uses TEST_PATTERN if provided)
|
||||
|
test-quick: check-deps |
||||
|
@echo "Running quick S3 delete tests..." |
||||
|
@if [ -z "$(TEST_PATTERN)" ]; then \
|
||||
|
go test -v -timeout=10m ./...; \
|
||||
|
else \
|
||||
|
go test -v -timeout=10m -run "$(TEST_PATTERN)" ./...; \
|
||||
|
fi |
||||
|
|
||||
|
# Run tests against external server (CI/CD mode)
|
||||
|
test-external: check-deps |
||||
|
@echo "Running tests against external server (USE_EXTERNAL_SERVER=true)..." |
||||
|
@USE_EXTERNAL_SERVER=true go test -v -timeout=10m ./... |
||||
|
|
||||
|
# Run tests with auto-managed server (CI/CD target)
|
||||
|
test-with-server: test |
||||
|
|
||||
|
# Clean up test artifacts
|
||||
|
clean: |
||||
|
@echo "Cleaning up test artifacts..." |
||||
|
@rm -f *.log *.pid |
||||
|
@go clean -testcache |
||||
|
@echo "✅ Cleanup completed" |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue