RSCBC-200: Add support for JWT authentication #884
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: | |
| tags: | |
| - v* | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Integration Test | |
| strategy: | |
| matrix: | |
| server: [ 8.0.0, 7.6.7, 7.2.7, 7.1.6, 7.0.4, community-8.0.0 ] | |
| include: | |
| - server: community-8.0.0 | |
| rcbserverVersion: 8.0.0-community | |
| 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.89/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" | |
| - name: Create fts index | |
| run: | | |
| curl -XPUT -H "Content-Type: application/json" -u Administrator:password http://${{ env.CBDC_IP }}:8094/api/index/basic_search_index -d '{"type": "fulltext-index","name": "basic_search_index","sourceType": "gocbcore","sourceName": "default","planParams": {"maxPartitionsPerPIndex": 1024,"indexPartitions": 1},"params": {"doc_config": {"docid_prefix_delim": "","docid_regexp": "","mode": "type_field","type_field": "type"},"mapping": {"analysis": {},"default_analyzer": "standard","default_datetime_parser": "dateTimeOptional","default_field": "_all","default_mapping": {"dynamic": true,"enabled": true},"default_type": "_default","docvalues_dynamic": true,"index_dynamic": true,"store_dynamic": true,"type_field": "_type"},"store": {"indexType": "scorch","segmentVersion": 15}},"sourceParams": {}}' | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust toolchain and cache | |
| uses: actions-rust-lang/[email protected] | |
| - name: Run tests | |
| timeout-minutes: 40 | |
| env: | |
| CBDC_ID: # from above | |
| CBDC_CONNSTR: # from above | |
| RCBDINOID: ${{ env.CBDC_ID }} | |
| RCBCONNSTR: ${{ env.CBDC_CONNSTR }} | |
| run: | | |
| if [[ -z "${{ matrix.rcbserverVersion }}" ]]; then | |
| export RCBSERVER_VERSION=${{ matrix.server }} | |
| else | |
| export RCBSERVER_VERSION=${{ matrix.rcbserverVersion }} | |
| fi | |
| 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 }} | |
| run: | | |
| if [[ -z "${{ matrix.rcbserverVersion }}" ]]; then | |
| export RCBSERVER_VERSION=${{ matrix.server }} | |
| else | |
| export RCBSERVER_VERSION=${{ matrix.rcbserverVersion }} | |
| fi | |
| cargo test --features dhat-heap --test allocations --color=always --no-fail-fast -- --nocapture | |
| # - name: Collect couchbase logs | |
| # timeout-minutes: 10 | |
| # if: failure() | |
| # run: | | |
| # mkdir -p ./logs | |
| # cbdinocluster -v collect-logs $CBDC_ID ./logs | |
| # | |
| # - name: Upload couchbase logs | |
| # if: failure() | |
| # uses: actions/upload-artifact@v3 | |
| # with: | |
| # name: cbcollect-logs | |
| # path: ./logs/* | |
| # retention-days: 1 |