name: Test Bats Unix on: pull_request: branches: [ main ] paths: - 'go/**' - 'integration-tests/**' concurrency: group: ci-bats-unix-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: test: name: Bats tests defaults: run: shell: bash runs-on: ${{ matrix.os }} strategy: fail-fast: true matrix: os: [ ubuntu-22.04 ] env: use_credentials: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' && secrets.AWS_ACCESS_KEY_ID != '' }} steps: # Docker entrypoint and docker tests in general may use more space than is available in the GitHub default runner, # so we remove unused pre-installed programs. - name: Free disk space run: | NAME="DISK-CLEANUP" echo "[${NAME}] Starting background cleanup..." [ -d /usr/share/dotnet ] && sudo rm -rf /usr/share/dotnet & [ -d /usr/local/lib/android ] && sudo rm -rf /usr/local/lib/android & [ -d /opt/ghc ] && sudo rm -rf /opt/ghc & [ -d /usr/local/share/boost ] && sudo rm -rf /usr/local/share/boost & - name: Conditionally Set ENV VARS for AWS tests run: | if [[ $use_credentials == true ]]; then echo "AWS_SDK_LOAD_CONFIG=1" >> $GITHUB_ENV echo "AWS_REGION=us-west-2" >> $GITHUB_ENV echo "DOLT_BATS_AWS_TABLE=dolt-ci-bats-manifests-us-west-2" >> $GITHUB_ENV echo "DOLT_BATS_AWS_BUCKET=dolt-ci-bats-chunks-us-west-2" >> $GITHUB_ENV echo "DOLT_BATS_AWS_EXISTING_REPO=aws_remote_bats_tests__dolt__" >> $GITHUB_ENV fi - name: Configure filter tags for lambda bats if: ${{ matrix.os == 'ubuntu-22.04' && env.use_credentials == 'true' }} run: | echo "BATS_FILTER=--filter-tags no_lambda" >> $GITHUB_ENV - name: Configure AWS Credentials if: ${{ env.use_credentials == 'true' }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-west-2 role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} role-duration-seconds: 10800 # 3 hours D: - uses: actions/checkout@v6 - name: Set up Go toolchain uses: ./.github/actions/setup-go-toolchain - name: Setup Python 3.x uses: actions/setup-python@v5 with: python-version: "3.10" - uses: actions/setup-node@v4 with: node-version: ^16 - name: Build dolt uses: ./.github/actions/build-dolt with: remotesrv: 'true' noms: 'true' - name: Install Bats run: | npm i bats echo "$(pwd)/node_modules/.bin" >> $GITHUB_PATH working-directory: ./.ci_bin - name: Install Python Deps run: | pip install mysql-connector-python pip install pandas pip install pyarrow - name: Setup Dolt Config uses: ./.github/actions/setup-dolt-config - name: Install expect if: matrix.os == 'ubuntu-22.04' run: sudo apt-get install -y expect - name: Install pcre2grep if: matrix.os == 'ubuntu-22.04' run: sudo apt-get install -y pcre2-utils - name: Install openssh-server if: matrix.os == 'ubuntu-22.04' run: sudo apt-get install -y openssh-server - name: Install Maven run: sudo apt-get install -y maven - name: Install Hadoop working-directory: ./.ci_bin run: | curl -LO https://downloads.apache.org/hadoop/common/hadoop-3.3.6/hadoop-3.3.6.tar.gz tar xvf hadoop-3.3.6.tar.gz echo "$(pwd)/hadoop-3.3.6/bin" >> $GITHUB_PATH - name: Install parquet-cli id: parquet_cli working-directory: ./.ci_bin run: | curl -OL https://github.com/apache/parquet-mr/archive/refs/tags/apache-parquet-1.12.3.tar.gz tar zxvf apache-parquet-1.12.3.tar.gz cd parquet-java-apache-parquet-1.12.3/parquet-cli mvn clean install -DskipTests runtime_jar="$(pwd)"/target/parquet-cli-1.12.3-runtime.jar echo "runtime_jar=$runtime_jar" >> $GITHUB_OUTPUT - name: Check expect run: expect -v - name: Test all Unix env: SQL_ENGINE: "local-engine" PARQUET_RUNTIME_JAR: ${{ steps.parquet_cli.outputs.runtime_jar }} BATS_TEST_RETRIES: "3" run: | bats --print-output-on-failure --tap $BATS_FILTER . working-directory: ./integration-tests/bats - name: Test all Unix, SQL_ENGINE=remote-engine # If we have AWS credentials, we run these remote-engine tests here instead of in the separate job. if: ${{ env.use_credentials == 'true' && matrix.os == 'ubuntu-22.04' }} env: SQL_ENGINE: "remote-engine" PARQUET_RUNTIME_JAR: ${{ steps.parquet_cli.outputs.runtime_jar }} BATS_TEST_RETRIES: "3" run: | bats --print-output-on-failure --tap $BATS_FILTER . working-directory: ./integration-tests/bats