Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
id: check_format
run: |
./check_repo.sh
./check_prepared_tests.sh
env:
BRANCH_NAME: ${{ github.head_ref }}
CHANGE_TARGET: ${{ github.base_ref }}
Expand All @@ -84,6 +85,7 @@ jobs:
if [ "$code" != 0 ]; then
echo "Please run ./format_repo.sh to fix this pull request's formatting"
fi
./check_prepared_tests.sh
env:
BRANCH_NAME: ${{ github.head_ref }}
CHANGE_TARGET: ${{ github.base_ref }}
16 changes: 16 additions & 0 deletions check_prepared_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -eo pipefail

enginetest_path=enginetest/memory_engine_test.go
all_cnt=$(grep "func Test.*" "$enginetest_path" | wc -l | tr -dc '0-9')
prep_cnt=$(grep "func Test.*Prepared" "$enginetest_path" | wc -l | tr -dc '0-9')
skip_cnt=$(grep "SkipPreparedsCount" "$enginetest_path" | awk '{print $4}' | tr -dc '0-9')

expected="$((all_cnt-skip_cnt))"
if [[ "$expected" != "$prep_cnt" ]]; then
echo "Expected '$expected' TestPrepared enginetests in $enginetest_path, found: '$prep_cnt'"
echo "Either increment SkipPreparedsCount or add a prepared test for the new test suite"
exit 1
fi

2 changes: 2 additions & 0 deletions enginetest/memory_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type indexBehaviorTestParams struct {
nativeIndexes bool
}

const SkipPreparedsCount = 91

const testNumPartitions = 5

var numPartitionsVals = []int{
Expand Down