diff --git a/.github/workflows/spark-integration-tests.yml b/.github/workflows/spark-integration-tests.yml index b9de013b6..285312202 100644 --- a/.github/workflows/spark-integration-tests.yml +++ b/.github/workflows/spark-integration-tests.yml @@ -185,23 +185,11 @@ jobs: curl -s http://localhost:9333/dir/status | jq '.' || echo "jq not available" echo "✓ Volume server registered, volumes will be created on-demand during tests" - - name: Build Spark integration tests + - name: Run Spark integration tests in Docker working-directory: test/java/spark run: | - echo "Building Spark integration tests..." - mvn clean package -DskipTests - echo "✓ Build completed" - - - name: Run Spark integration tests - working-directory: test/java/spark - env: - SEAWEEDFS_TEST_ENABLED: true - SEAWEEDFS_FILER_HOST: localhost - SEAWEEDFS_FILER_PORT: 8888 - SEAWEEDFS_FILER_GRPC_PORT: 18888 - run: | - echo "Running Spark integration tests..." - mvn test -B + echo "Running Spark integration tests in Docker container..." + docker compose up --abort-on-container-exit --exit-code-from spark-tests spark-tests echo "✓ Tests completed" - name: Upload test results diff --git a/test/java/spark/docker-compose.yml b/test/java/spark/docker-compose.yml index 713bf68a1..a170d7464 100644 --- a/test/java/spark/docker-compose.yml +++ b/test/java/spark/docker-compose.yml @@ -27,7 +27,7 @@ services: ports: - "8080:8080" - "18080:18080" - command: "volume -mserver=seaweedfs-master:9333 -ip=seaweedfs-volume -ip.bind=0.0.0.0 -port=8080 -port.grpc=18080 -publicUrl=localhost:8080 -max=100 -dir=/data -preStopSeconds=1" + command: "volume -mserver=seaweedfs-master:9333 -ip=seaweedfs-volume -ip.bind=0.0.0.0 -port=8080 -port.grpc=18080 -publicUrl=seaweedfs-volume:8080 -max=100 -dir=/data -preStopSeconds=1" volumes: - seaweedfs-volume-data:/data depends_on: @@ -69,18 +69,22 @@ services: spark-tests: image: maven:3.9-eclipse-temurin-17 container_name: seaweedfs-spark-tests - network_mode: "host" volumes: - .:/workspace - ~/.m2:/root/.m2 working_dir: /workspace environment: - SEAWEEDFS_TEST_ENABLED=true - - SEAWEEDFS_FILER_HOST=localhost + - SEAWEEDFS_FILER_HOST=seaweedfs-filer - SEAWEEDFS_FILER_PORT=8888 - SEAWEEDFS_FILER_GRPC_PORT=18888 - HADOOP_HOME=/tmp command: sh -c "sleep 30 && mvn test" + depends_on: + seaweedfs-filer: + condition: service_healthy + networks: + - seaweedfs-spark mem_limit: 4g cpus: 2