Run Tests #1202
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| schedule: | |
| - cron: "0 5 * * *" # daily at 05:00 UTC | |
| jobs: | |
| test: | |
| name: Integration Test | |
| strategy: | |
| matrix: | |
| server: [ 8.0.0, 7.6.7, 7.2.7, 7.1.6, 7.0.4 ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install cbdinocluster | |
| run: | | |
| mkdir -p "$HOME/bin" | |
| wget -nv -O $HOME/bin/cbdinocluster https://github.com/couchbaselabs/cbdinocluster/releases/download/v0.0.100/cbdinocluster-linux-amd64 | |
| chmod +x $HOME/bin/cbdinocluster | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Initialize cbdinocluster | |
| run: | | |
| cbdinocluster -v init --auto | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Start couchbase cluster | |
| env: | |
| CLUSTERCONFIG: | | |
| nodes: | |
| - count: 3 | |
| version: ${{ matrix.server }} | |
| services: [kv, n1ql, index, fts] | |
| docker: | |
| kv-memory: 2048 | |
| fts-memory: 2048 | |
| run: | | |
| CBDC_ID=$(cbdinocluster -v alloc --def="${CLUSTERCONFIG}") | |
| cbdinocluster -v buckets add ${CBDC_ID} default --ram-quota-mb=100 --flush-enabled=true --num-replicas=2 | |
| cbdinocluster -v collections add ${CBDC_ID} default _default test | |
| CBDC_IP=$(cbdinocluster -v ip $CBDC_ID) | |
| echo "CBDC_ID=$CBDC_ID" >> "$GITHUB_ENV" | |
| echo "CBDC_IP=$CBDC_IP" >> "$GITHUB_ENV" | |
| - name: Set connection string | |
| run: | | |
| if [[ "${{ matrix.server }}" == community* ]]; then | |
| CBDC_CONNSTR=$(cbdinocluster -v connstr $CBDC_ID) | |
| else | |
| CBDC_CONNSTR=$(cbdinocluster -v connstr --tls $CBDC_ID) | |
| fi | |
| echo "CBDC_CONNSTR=$CBDC_CONNSTR" >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain and cache | |
| uses: actions-rust-lang/setup-rust-toolchain@v1.4.3 | |
| - name: Run tests | |
| timeout-minutes: 40 | |
| env: | |
| CBDC_ID: # from above | |
| CBDC_CONNSTR: # from above | |
| RCBDINOID: ${{ env.CBDC_ID }} | |
| RCBCONNSTR: ${{ env.CBDC_CONNSTR }} | |
| RCBSERVER_VERSION: ${{ matrix.server }} | |
| run: | | |
| cargo test --color=always --no-fail-fast -- --nocapture | |
| - name: Run allocation tests | |
| timeout-minutes: 40 | |
| env: | |
| CBDC_ID: # from above | |
| CBDC_CONNSTR: # from above | |
| RCBDINOID: ${{ env.CBDC_ID }} | |
| RCBCONNSTR: ${{ env.CBDC_CONNSTR }} | |
| RCBSERVER_VERSION: ${{ matrix.server }} | |
| run: | | |
| cargo test --features dhat-heap --test allocations --color=always --no-fail-fast -- --nocapture |