diff options
| author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2025-11-19 21:22:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-19 21:22:18 -0800 |
| commit | c14e513964ff708b7ace352b7e86198b3ebe6827 (patch) | |
| tree | fc64d74d241faf292d2b37177e266614e15d9d18 /.github | |
| parent | 7dce429e61037529694727134f828d273704f8ec (diff) | |
| download | seaweedfs-c14e513964ff708b7ace352b7e86198b3ebe6827.tar.xz seaweedfs-c14e513964ff708b7ace352b7e86198b3ebe6827.zip | |
chore(deps): bump org.apache.hadoop:hadoop-common from 3.2.4 to 3.4.0 in /other/java/hdfs3 (#7512)
* chore(deps): bump org.apache.hadoop:hadoop-common in /other/java/hdfs3
Bumps org.apache.hadoop:hadoop-common from 3.2.4 to 3.4.0.
---
updated-dependencies:
- dependency-name: org.apache.hadoop:hadoop-common
dependency-version: 3.4.0
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* add java client unit tests
* Update dependency-reduced-pom.xml
* add java integration tests
* fix
* fix buffer
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: chrislu <chris.lu@gmail.com>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/java_integration_tests.yml | 170 | ||||
| -rw-r--r-- | .github/workflows/java_unit_tests.yml | 64 |
2 files changed, 234 insertions, 0 deletions
diff --git a/.github/workflows/java_integration_tests.yml b/.github/workflows/java_integration_tests.yml new file mode 100644 index 000000000..9b86d8e69 --- /dev/null +++ b/.github/workflows/java_integration_tests.yml @@ -0,0 +1,170 @@ +name: Java Client Integration Tests + +on: + push: + branches: [ master ] + paths: + - 'other/java/**' + - 'weed/**' + - '.github/workflows/java_integration_tests.yml' + pull_request: + branches: [ master ] + paths: + - 'other/java/**' + - 'weed/**' + - '.github/workflows/java_integration_tests.yml' + +jobs: + test: + name: Java Integration Tests + runs-on: ubuntu-latest + + strategy: + matrix: + java: ['11', '17'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: 'go.mod' + id: go + + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: 'maven' + + - name: Build SeaweedFS + run: | + cd weed + go install -buildvcs=false + weed version + + - name: Start SeaweedFS Server + run: | + # Create clean data directory + export WEED_DATA_DIR="/tmp/seaweedfs-java-tests-$(date +%s)" + mkdir -p "$WEED_DATA_DIR" + + # Start SeaweedFS with optimized settings for CI + weed server -dir="$WEED_DATA_DIR" \ + -master.raftHashicorp \ + -master.electionTimeout=1s \ + -master.volumeSizeLimitMB=100 \ + -volume.max=100 \ + -volume.preStopSeconds=1 \ + -master.peers=none \ + -filer -filer.maxMB=64 \ + -master.port=9333 \ + -volume.port=8080 \ + -filer.port=8888 \ + -metricsPort=9324 > seaweedfs.log 2>&1 & + + SERVER_PID=$! + echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV + echo "WEED_DATA_DIR=$WEED_DATA_DIR" >> $GITHUB_ENV + echo "SeaweedFS server started with PID: $SERVER_PID" + + - name: Wait for SeaweedFS Components + run: | + echo "Waiting for SeaweedFS components to start..." + + # Wait for master + for i in {1..30}; do + if curl -s http://localhost:9333/cluster/status > /dev/null 2>&1; then + echo "✓ Master server is ready" + break + fi + echo "Waiting for master server... ($i/30)" + sleep 2 + done + + # Wait for volume + for i in {1..30}; do + if curl -s http://localhost:8080/status > /dev/null 2>&1; then + echo "✓ Volume server is ready" + break + fi + echo "Waiting for volume server... ($i/30)" + sleep 2 + done + + # Wait for filer + for i in {1..30}; do + if curl -s http://localhost:8888/ > /dev/null 2>&1; then + echo "✓ Filer is ready" + break + fi + echo "Waiting for filer... ($i/30)" + sleep 2 + done + + echo "✓ All SeaweedFS components are ready!" + + # Display cluster status + echo "Cluster status:" + curl -s http://localhost:9333/cluster/status | head -20 + + - name: Build and Install SeaweedFS Client + working-directory: other/java/client + run: | + mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Run Client Unit Tests + working-directory: other/java/client + run: | + mvn test -Dtest=SeaweedReadTest,SeaweedCipherTest + + - name: Run Client Integration Tests + working-directory: other/java/client + env: + SEAWEEDFS_TEST_ENABLED: true + run: | + mvn test -Dtest=*IntegrationTest + + - name: Run HDFS2 Configuration Tests + working-directory: other/java/hdfs2 + run: | + mvn test -Dtest=SeaweedFileSystemConfigTest -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Run HDFS3 Configuration Tests + working-directory: other/java/hdfs3 + run: | + mvn test -Dtest=SeaweedFileSystemConfigTest -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Display logs on failure + if: failure() + run: | + echo "=== SeaweedFS Server Log ===" + tail -100 seaweedfs.log || echo "No server log" + echo "" + echo "=== Cluster Status ===" + curl -s http://localhost:9333/cluster/status || echo "Cannot reach cluster" + echo "" + echo "=== Process Status ===" + ps aux | grep weed || echo "No weed processes" + + - name: Cleanup + if: always() + run: | + # Stop server using stored PID + if [ -n "$SERVER_PID" ]; then + echo "Stopping SeaweedFS server (PID: $SERVER_PID)" + kill -9 $SERVER_PID 2>/dev/null || true + fi + + # Fallback: kill any remaining weed processes + pkill -f "weed server" || true + + # Clean up data directory + if [ -n "$WEED_DATA_DIR" ]; then + echo "Cleaning up data directory: $WEED_DATA_DIR" + rm -rf "$WEED_DATA_DIR" || true + fi + diff --git a/.github/workflows/java_unit_tests.yml b/.github/workflows/java_unit_tests.yml new file mode 100644 index 000000000..e79499b04 --- /dev/null +++ b/.github/workflows/java_unit_tests.yml @@ -0,0 +1,64 @@ +name: Java Client Unit Tests + +on: + push: + branches: [ master ] + paths: + - 'other/java/**' + - '.github/workflows/java_unit_tests.yml' + pull_request: + branches: [ master ] + paths: + - 'other/java/**' + - '.github/workflows/java_unit_tests.yml' + +jobs: + test: + name: Java Unit Tests + runs-on: ubuntu-latest + + strategy: + matrix: + java: ['8', '11', '17', '21'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: 'maven' + + - name: Build and Install SeaweedFS Client + working-directory: other/java/client + run: | + mvn clean install -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Run Client Unit Tests + working-directory: other/java/client + run: | + mvn test -Dtest=SeaweedReadTest,SeaweedCipherTest + + - name: Run HDFS2 Configuration Tests + working-directory: other/java/hdfs2 + run: | + mvn test -Dtest=SeaweedFileSystemConfigTest -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Run HDFS3 Configuration Tests + working-directory: other/java/hdfs3 + run: | + mvn test -Dtest=SeaweedFileSystemConfigTest -Dmaven.javadoc.skip=true -Dgpg.skip=true + + - name: Upload Test Reports + if: always() + uses: actions/upload-artifact@v5 + with: + name: test-reports-java-${{ matrix.java }} + path: | + other/java/client/target/surefire-reports/ + other/java/hdfs2/target/surefire-reports/ + other/java/hdfs3/target/surefire-reports/ + |
