Skip to content
Open
56 changes: 0 additions & 56 deletions .github/workflows/ci-binlog-tests.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/ci-go-race-tests.yaml

This file was deleted.

117 changes: 43 additions & 74 deletions .github/workflows/ci-go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,64 @@ name: Test Go

on:
pull_request:
branches: [ main ]
branches: [main]
paths:
- 'go/**'
- '.github/workflows/ci-go-tests.yaml'
- '.github/actions/setup-go-toolchain/**'
push:
branches: [main]
paths:
- 'go/**'
- '.github/workflows/ci-go-tests.yaml'
- '.github/actions/setup-go-toolchain/**'
workflow_dispatch:

concurrency:
group: ci-go-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
enumerate-shards:
name: Enumerate shards
runs-on: ubuntu-22.04
outputs:
combos: ${{ steps.list.outputs.combos }}
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-go-toolchain
- name: List shard combos
id: list
working-directory: ./go
run: |
combos=$(go run ./utils/cigotests list)
echo "combos=$combos" >> "$GITHUB_OUTPUT"
echo "$combos" | python3 -m json.tool

test:
name: Go tests
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
name: ${{ matrix.shard }} (${{ matrix.os }})
needs: enumerate-shards
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Set up Go toolchain
id: toolchain
uses: ./.github/actions/setup-go-toolchain
- name: Test All
working-directory: ./go
run: |
files=$(go list ./...)
SAVEIFS=$IFS
IFS=$'\n'
file_arr=($files)
IFS=$SAVEIFS
if [ "$MATRIX_OS" == 'windows-latest' ]; then
export PATH=$(cygpath -u "$MSYS2_LOCATION"/ucrt64/bin):"$PATH"
fi

for (( i=0; i<${#file_arr[@]}; i++ ))
do
# Skip binlog tests as they run in a separate CI job
if [[ "${file_arr[$i]}" == *binlogreplication* ]]; then
echo "Skipping binlog package: ${file_arr[$i]} (runs in separate CI)"
continue
fi

echo "Testing Package: ${file_arr[$i]}"
if [ "$MATRIX_OS" == 'ubuntu-22.04' ]
then
if [[ "${file_arr[$i]}" != *enginetest* ]]; then
go test -vet=off -timeout 45m -race "${file_arr[$i]}"
else
echo "skipping enginetests for -race"
fi
else
go test -vet=off -timeout 45m "${file_arr[$i]}"
fi
succeeded=$(echo "$?")
if [ "$succeeded" -ne 0 ]; then
echo "Testing failed in package ${file_arr[$i]}"
exit 1;
fi
done
env:
MATRIX_OS: ${{ matrix.os }}
MSYS2_LOCATION: ${{ steps.toolchain.outputs.msys2-location }}
noracetest:
name: Go tests - no race
include: ${{ fromJson(needs.enumerate-shards.outputs.combos) }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Set up Go toolchain
id: toolchain
uses: ./.github/actions/setup-go-toolchain
- name: Test All
working-directory: ./go
run: |
if [ "$MATRIX_OS" == 'windows-latest' ]; then
export PATH=$(cygpath -u "$MSYS2_LOCATION"/ucrt64/bin):"$PATH"
fi
go test -vet=off -timeout 30m ./libraries/doltcore/sqle/integration_test
env:
MATRIX_OS: ${{ matrix.os }}
DOLT_TEST_RUN_NON_RACE_TESTS: "true"
MSYS2_LOCATION: ${{ steps.toolchain.outputs.msys2-location }}
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-go-toolchain
id: toolchain
- name: Run shard
working-directory: ./go
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
export PATH=$(cygpath -u "$MSYS2_LOCATION"/ucrt64/bin):"$PATH"
fi
go run ./utils/cigotests run \
--shard "${{ matrix.shard }}" \
--os "${{ matrix.os }}" \
--event "${{ github.event_name }}"
env:
MSYS2_LOCATION: ${{ steps.toolchain.outputs.msys2-location }}
Loading
Loading