# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. name: Behavior Test Core on: workflow_call: inputs: os: required: true type: string cases: required: true type: string enable_secrets: required: false type: boolean default: false retry_attempts: required: false type: number default: 1 secrets: OP_CONNECT_HOST: required: false OP_CONNECT_TOKEN: required: false jobs: test: name: ${{ matrix.cases.label || matrix.cases.service }} runs-on: ${{ inputs.os }} strategy: fail-fast: false matrix: cases: ${{ fromJson(inputs.cases) }} steps: - uses: actions/checkout@v7 - name: Setup Rust toolchain uses: ./.github/actions/setup with: need-protoc: true # 3FS builds its bundled RocksDB; its Rust service does not use this copy. need-rocksdb: ${{ matrix.cases.service != 'hf3fs' }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Test Core id: test continue-on-error: ${{ inputs.retry_attempts > 1 }} uses: ./.github/actions/test_behavior_core with: setups: ${{ join(matrix.cases.setups, ',') }} service: ${{ matrix.cases.service }} feature: ${{ matrix.cases.feature }} op-connect-host: ${{ inputs.enable_secrets && secrets.OP_CONNECT_HOST || '' }} op-connect-token: ${{ inputs.enable_secrets && secrets.OP_CONNECT_TOKEN || '' }} env: # Forward the workflow token only for live/secret-enabled runs so # deterministic local runs never inject external API tokens. GITHUB_TOKEN: ${{ inputs.enable_secrets && secrets.GITHUB_TOKEN || '' }} - name: Retry Test Core if: steps.test.outcome == 'failure' && inputs.retry_attempts > 1 uses: ./.github/actions/test_behavior_core with: setups: ${{ join(matrix.cases.setups, ',') }} service: ${{ matrix.cases.service }} feature: ${{ matrix.cases.feature }} op-connect-host: ${{ inputs.enable_secrets && secrets.OP_CONNECT_HOST || '' }} op-connect-token: ${{ inputs.enable_secrets && secrets.OP_CONNECT_TOKEN || '' }} env: GITHUB_TOKEN: ${{ inputs.enable_secrets && secrets.GITHUB_TOKEN || '' }} - name: Stop 3FS if: always() && matrix.cases.service == 'hf3fs' shell: bash run: | sudo journalctl -u opendal-hf3fs --no-pager > "$RUNNER_TEMP/hf3fs-journal.log" 2>&1 || true sudo systemctl stop opendal-hf3fs || true fusermount3 -u "$RUNNER_TEMP/hf3fs-cluster/mnt" 2>/dev/null || true sudo rdma link delete opendal_rxe 2>/dev/null || true - name: Upload 3FS logs if: always() && matrix.cases.service == 'hf3fs' uses: actions/upload-artifact@v7 with: name: hf3fs-logs path: | ${{ runner.temp }}/hf3fs-journal.log ${{ runner.temp }}/hf3fs-cluster/log