|
| 1 | +name: Run Load Tests |
| 2 | +permissions: |
| 3 | + contents: read |
| 4 | + packages: read |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - v* |
| 10 | + branches: |
| 11 | + - master |
| 12 | + pull_request: |
| 13 | + |
| 14 | +jobs: |
| 15 | + load-test: |
| 16 | + name: Load Test |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + server: |
| 20 | + - 8.1.0-1262 |
| 21 | + - 8.0.0 |
| 22 | + - 7.6.8 |
| 23 | + - 7.2.8 |
| 24 | + |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + with: |
| 29 | + submodules: recursive |
| 30 | + - name: Install cbdinocluster |
| 31 | + uses: ./.github/actions/install-cbdinocluster |
| 32 | + with: |
| 33 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + - name: Start couchbase cluster |
| 35 | + id: start-cluster |
| 36 | + uses: ./.github/actions/start-couchbase-cluster |
| 37 | + - uses: actions/setup-go@v5 |
| 38 | + with: |
| 39 | + go-version: 1.26 |
| 40 | + |
| 41 | + - name: Clone and Build spectroperf |
| 42 | + run: | |
| 43 | + git clone -b configure-artefact-file-name https://github.com/couchbaselabs/spectroperf.git |
| 44 | + cd spectroperf |
| 45 | + go build -o spectroperf spectroperf.go |
| 46 | + mv spectroperf ../sp |
| 47 | +
|
| 48 | + - name: Write spectroperf config |
| 49 | + run: | |
| 50 | + cat > direct_config.toml << EOF |
| 51 | + connstr = "couchbase://${{ steps.start-cluster.outputs.node-ip }}" |
| 52 | + num-users = [1000, 2000, 4000, 8000, 16000] |
| 53 | + ramp-time = "10s" |
| 54 | + run-time = "30s" |
| 55 | + workload = "user-profile" |
| 56 | + sleep = "1s" |
| 57 | + tls-skip-verify = true |
| 58 | + bucket = "default" |
| 59 | + scope = "_default" |
| 60 | + collection = "_default" |
| 61 | + results = "direct" |
| 62 | + EOF |
| 63 | +
|
| 64 | + - name: Run spectroperf |
| 65 | + run: | |
| 66 | + ls |
| 67 | + ./sp --config-file="direct_config.toml" |
| 68 | +
|
| 69 | + - name: Print metrics |
| 70 | + run: | |
| 71 | + cat ./direct/metrics.json |
| 72 | +
|
| 73 | + - uses: arduino/setup-protoc@v3 |
| 74 | + with: |
| 75 | + version: 31.1 |
| 76 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + - name: Install Tools |
| 78 | + run: | |
| 79 | + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36 |
| 80 | + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5 |
| 81 | + go install github.com/matryer/moq@v0.5 |
| 82 | + - name: Install Dependencies |
| 83 | + run: go get ./... |
| 84 | + - name: Generate Files |
| 85 | + run: go generate ./... |
| 86 | + - name: Build and Start Gateway |
| 87 | + env: |
| 88 | + SGTEST_CBCONNSTR: ${{ steps.start-cluster.outputs.node-ip }} |
| 89 | + run: | |
| 90 | + go build -o stellar-gateway ./cmd/gateway |
| 91 | + ./stellar-gateway --self-sign & |
| 92 | + sleep 5 |
| 93 | +
|
| 94 | + |
| 95 | +
|
| 96 | + - name: Collect couchbase logs |
| 97 | + timeout-minutes: 10 |
| 98 | + if: failure() |
| 99 | + run: | |
| 100 | + mkdir -p ./logs |
| 101 | + cbdinocluster -v collect-logs ${{ steps.start-cluster.outputs.dino-id }} ./logs |
| 102 | + - name: Upload couchbase logs |
| 103 | + if: failure() |
| 104 | + uses: actions/upload-artifact@v4 |
| 105 | + with: |
| 106 | + name: cbcollect-logs-${{ matrix.server }} |
| 107 | + path: ./logs/* |
| 108 | + retention-days: 5 |
0 commit comments