fix incremental logic

This commit is contained in:
jay brown
2025-07-22 11:42:47 -07:00
parent a9d81a1094
commit 00a46eb629
+7 -11
View File
@@ -55,24 +55,19 @@ tasks:
TEST_TARGETS="" TEST_TARGETS=""
NEED_COVERAGE_MERGE=false NEED_COVERAGE_MERGE=false
# Check if we should run full tests # INCREMENTAL=false takes absolute precedence - force full test mode
if [ "{{.INCREMENTAL}}" = "false" ]; then if [ "{{.INCREMENTAL}}" = "false" ]; then
echo "Running full test suite (INCREMENTAL=false)..." echo "Running full test suite (INCREMENTAL=false)..."
TEST_MODE="full" TEST_MODE="full"
fi else
# Only process incremental logic if INCREMENTAL != false
if [ "{{.INCREMENTAL}}" = "true" ] && [ ! -f "{{.COVERAGE_FILE}}" ]; then if [ ! -f "{{.COVERAGE_FILE}}" ]; then
echo "No existing coverage file found, running full tests to establish baseline" echo "No existing coverage file found, running full tests to establish baseline"
TEST_MODE="full" TEST_MODE="full"
fi elif ! git rev-parse origin/main >/dev/null 2>&1; then
if [ "{{.INCREMENTAL}}" = "true" ] && [ -f "{{.COVERAGE_FILE}}" ] && ! git rev-parse origin/main >/dev/null 2>&1; then
echo "Cannot find origin/main branch, defaulting to full tests" echo "Cannot find origin/main branch, defaulting to full tests"
TEST_MODE="full" TEST_MODE="full"
fi elif git rev-parse origin/main >/dev/null 2>&1; then
# Handle incremental mode
if [ "{{.INCREMENTAL}}" = "true" ] && [ -f "{{.COVERAGE_FILE}}" ] && git rev-parse origin/main >/dev/null 2>&1; then
echo "Running incremental test suite (INCREMENTAL=true)..." echo "Running incremental test suite (INCREMENTAL=true)..."
echo "Checking for Go files changed since origin/main..." echo "Checking for Go files changed since origin/main..."
@@ -98,6 +93,7 @@ tasks:
fi fi
fi fi
fi fi
fi
# Set targets for full tests # Set targets for full tests
if [ "$TEST_MODE" = "full" ]; then if [ "$TEST_MODE" = "full" ]; then