mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-26 06:50:45 +01:00
GitHub is retiring ubuntu-22.04; move all 94 runs-on pins across 40 workflows to ubuntu-24.04. rust_binaries_release: the arm64 cross step was jammy-era — noble keeps apt sources in deb822 ubuntu.sources (the sources.list edit was a silent no-op that left amd64 repos open to arm64 and 404'd) and ports suites must say noble. Pin deb822 stanzas to amd64 and add noble ports entries.
144 lines
5.0 KiB
YAML
144 lines
5.0 KiB
YAML
name: "Volume Server Integration Tests"
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths:
|
|
- 'test/volume_server/**'
|
|
- 'weed/server/**'
|
|
- 'weed/storage/**'
|
|
- 'weed/pb/volume_server.proto'
|
|
- 'weed/pb/volume_server_pb/**'
|
|
- '.github/workflows/volume-server-integration-tests.yml'
|
|
push:
|
|
branches: [ master, main ]
|
|
paths:
|
|
- 'test/volume_server/**'
|
|
- 'weed/server/**'
|
|
- 'weed/storage/**'
|
|
- 'weed/pb/volume_server.proto'
|
|
- 'weed/pb/volume_server_pb/**'
|
|
- '.github/workflows/volume-server-integration-tests.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
TEST_TIMEOUT: '30m'
|
|
# Keep in step with the length of matrix.shard below.
|
|
SHARD_COUNT: 3
|
|
|
|
jobs:
|
|
build-weed:
|
|
name: Build SeaweedFS Binary
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
- name: Build SeaweedFS binary
|
|
run: |
|
|
cd weed
|
|
go build -o weed .
|
|
chmod +x weed
|
|
./weed version
|
|
|
|
- name: Package binary
|
|
run: tar cf weed-binary.tar weed/weed
|
|
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: weed-binary
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
path: weed-binary.tar
|
|
|
|
volume-server-integration-tests:
|
|
name: Volume Server Integration Tests (${{ matrix.test-type }} - Shard ${{ matrix.shard }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 45
|
|
needs: [build-weed]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
test-type: [grpc, http]
|
|
shard: [1, 2, 3]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: weed-binary
|
|
|
|
- name: Restore binary
|
|
run: |
|
|
tar xf weed-binary.tar
|
|
chmod +x weed/weed
|
|
./weed/weed version
|
|
|
|
# Dealing the listed tests out one by one keeps the shards even. Bucketing
|
|
# them by first letter did not: names cluster, so ^Test[I-S] drew 50 of
|
|
# the 114 grpc tests and ran nearly twice as long as the other two shards.
|
|
- name: Select this shard's tests
|
|
env:
|
|
TEST_TYPE: ${{ matrix.test-type }}
|
|
SHARD: ${{ matrix.shard }}
|
|
run: |
|
|
tests=$(go test ./test/volume_server/"$TEST_TYPE"/... -list '.*' | grep '^Test' | sort -u)
|
|
# An empty list would make -run match nothing and the shard pass vacuously.
|
|
[ -n "$tests" ] || { echo "listed no tests in test/volume_server/$TEST_TYPE"; exit 1; }
|
|
selected=$(echo "$tests" | awk -v n="$SHARD_COUNT" -v i="$SHARD" 'NR % n == i - 1')
|
|
echo "shard $SHARD of $SHARD_COUNT runs $(echo "$selected" | wc -l) of $(echo "$tests" | wc -l) tests"
|
|
echo "TEST_PATTERN=^($(echo "$selected" | paste -sd'|' -))\$" >> "$GITHUB_ENV"
|
|
|
|
- name: Run volume server integration tests
|
|
env:
|
|
WEED_BINARY: ${{ github.workspace }}/weed/weed
|
|
run: |
|
|
echo "Running volume server integration tests for ${{ matrix.test-type }} (Shard ${{ matrix.shard }} of ${SHARD_COUNT})..."
|
|
go test -v -count=1 -timeout=${{ env.TEST_TIMEOUT }} ./test/volume_server/${{ matrix.test-type }}/... -run "${TEST_PATTERN}"
|
|
|
|
- name: Collect logs on failure
|
|
if: failure()
|
|
run: |
|
|
mkdir -p /tmp/volume-server-it-logs
|
|
find /tmp -maxdepth 1 -type d -name "seaweedfs_volume_server_it_*" -print -exec cp -r {} /tmp/volume-server-it-logs/ \; || true
|
|
|
|
- name: Archive logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: volume-server-integration-test-logs
|
|
path: /tmp/volume-server-it-logs/
|
|
if-no-files-found: warn
|
|
retention-days: 7
|
|
|
|
- name: Test summary
|
|
if: always()
|
|
run: |
|
|
echo "## Volume Server Integration Test Summary (${{ matrix.test-type }} - Shard ${{ matrix.shard }})" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- Suite: test/volume_server/${{ matrix.test-type }} (shard ${{ matrix.shard }} of ${SHARD_COUNT}, see 'Select this shard's tests' for the split)" >> "$GITHUB_STEP_SUMMARY"
|
|
echo "- Command: go test -v -count=1 -timeout=${{ env.TEST_TIMEOUT }} ./test/volume_server/${{ matrix.test-type }}/... -run \"\${TEST_PATTERN}\"" >> "$GITHUB_STEP_SUMMARY"
|