From f5112ad17caf540f2c1377fedf0f4bd44297ea05 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 26 Aug 2025 19:36:02 -0700 Subject: [PATCH] dedup in makefile --- test/s3/iam/Makefile | 85 +++++++++----------------------------------- 1 file changed, 17 insertions(+), 68 deletions(-) diff --git a/test/s3/iam/Makefile b/test/s3/iam/Makefile index b30761b81..c026339c9 100644 --- a/test/s3/iam/Makefile +++ b/test/s3/iam/Makefile @@ -26,14 +26,23 @@ help: ## Show this help message @echo "Usage:" @echo " make [target]" @echo "" - @echo "Targets:" - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST) + @echo "Standard Targets:" + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-25s %s\n", $$1, $$2}' $(MAKEFILE_LIST) | head -20 + @echo "" + @echo "New Test Targets (Previously Skipped):" + @echo " test-distributed Run distributed IAM tests" + @echo " test-performance Run performance tests" + @echo " test-stress Run stress tests" + @echo " test-versioning-stress Run S3 versioning stress tests" + @echo " test-keycloak-full Run complete Keycloak integration tests" + @echo " test-all-previously-skipped Run all previously skipped tests" + @echo " setup-all-tests Setup environment for all tests" @echo "" @echo "Docker Compose Targets:" - @echo " docker-test Run tests with Docker Compose including Keycloak" - @echo " docker-up Start all services with Docker Compose" - @echo " docker-down Stop all Docker Compose services" - @echo " docker-logs Show logs from all services" + @echo " docker-test Run tests with Docker Compose including Keycloak" + @echo " docker-up Start all services with Docker Compose" + @echo " docker-down Stop all Docker Compose services" + @echo " docker-logs Show logs from all services" test: clean setup start-services wait-for-services run-tests stop-services ## Run complete IAM integration test suite @@ -241,6 +250,7 @@ docker-build: ## Build custom SeaweedFS image for Docker tests .PHONY: test test-quick run-tests setup start-services stop-services wait-for-services clean logs status debug .PHONY: test-auth test-policy test-expiration test-multipart test-bucket-policy test-context test-presigned .PHONY: benchmark ci watch install-deps docker-test docker-up docker-down docker-logs docker-build +.PHONY: test-distributed test-performance test-stress test-versioning-stress test-keycloak-full test-all-previously-skipped setup-all-tests help-advanced @@ -279,7 +289,7 @@ setup-all-tests: ## Setup environment for all tests (including Keycloak) @./setup_all_tests.sh # Update help target -help: ## Show this help message +help-advanced: ## Show advanced help with all test targets @echo "SeaweedFS S3 IAM Integration Tests" @echo "" @echo "Usage:" @@ -302,64 +312,3 @@ help: ## Show this help message @echo " docker-up Start all services with Docker Compose" @echo " docker-down Stop all Docker Compose services" @echo " docker-logs Show logs from all services" - - -# New test targets for previously skipped tests - -test-distributed: ## Run distributed IAM tests - @echo "🌐 Running distributed IAM tests..." - @export ENABLE_DISTRIBUTED_TESTS=true && go test -v -timeout $(TEST_TIMEOUT) -run "TestS3IAMDistributedTests" ./... - -test-performance: ## Run performance tests - @echo "🏁 Running performance tests..." - @export ENABLE_PERFORMANCE_TESTS=true && go test -v -timeout $(TEST_TIMEOUT) -run "TestS3IAMPerformanceTests" ./... - -test-stress: ## Run stress tests - @echo "💪 Running stress tests..." - @export ENABLE_STRESS_TESTS=true && ./run_stress_tests.sh - -test-versioning-stress: ## Run S3 versioning stress tests - @echo "📚 Running versioning stress tests..." - @cd ../versioning && ./enable_stress_tests.sh - -test-keycloak-full: docker-up ## Run complete Keycloak integration tests - @echo "🔐 Running complete Keycloak integration tests..." - @export KEYCLOAK_URL="http://localhost:8080" && \ - export S3_ENDPOINT="http://localhost:8333" && \ - sleep 15 && \ - go test -v -timeout $(TEST_TIMEOUT) -run "TestKeycloak" ./... - @make docker-down - -test-all-previously-skipped: ## Run all previously skipped tests - @echo "🎯 Running all previously skipped tests..." - @./run_all_tests.sh - -setup-all-tests: ## Setup environment for all tests (including Keycloak) - @echo "🚀 Setting up complete test environment..." - @./setup_all_tests.sh - -# Update help target -help: ## Show this help message - @echo "SeaweedFS S3 IAM Integration Tests" - @echo "" - @echo "Usage:" - @echo " make [target]" - @echo "" - @echo "Standard Targets:" - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-25s %s\n", $$1, $$2}' $(MAKEFILE_LIST) | head -20 - @echo "" - @echo "New Test Targets (Previously Skipped):" - @echo " test-distributed Run distributed IAM tests" - @echo " test-performance Run performance tests" - @echo " test-stress Run stress tests" - @echo " test-versioning-stress Run S3 versioning stress tests" - @echo " test-keycloak-full Run complete Keycloak integration tests" - @echo " test-all-previously-skipped Run all previously skipped tests" - @echo " setup-all-tests Setup environment for all tests" - @echo "" - @echo "Docker Compose Targets:" - @echo " docker-test Run tests with Docker Compose including Keycloak" - @echo " docker-up Start all services with Docker Compose" - @echo " docker-down Stop all Docker Compose services" - @echo " docker-logs Show logs from all services" -