Files
PrivateCaptcha/docker/run-tests.sh
Taras Kushnir decbbc8679 Fix typo
2025-07-09 12:55:23 +03:00

32 lines
677 B
Bash
Executable File

#!/bin/bash
set -e
echo "Started in $PWD"
# echo "Compiling... (GOCACHE=$GOCACHE)"
# env GOFLAGS="-mod=vendor" CGO_ENABLED=0 go test -c -o tests/ ./...
TESTS_DIR="tests"
COVERAGE_DIR="coverage_reports"
if [ ! -d "$TESTS_DIR" ]; then
echo "Tests directory does not exist"
exit 1
fi
if [ -z "$(ls -A $TESTS_DIR)" ]; then
echo "No tests available"
exit 2
fi
mkdir -p "$COVERAGE_DIR"
for f in `ls $TESTS_DIR/`; do
echo "Running $f..."
./$TESTS_DIR/$f -test.v -test.parallel 1 -test.coverprofile="$COVERAGE_DIR/$f.cov" # -test.run "^TestUniqueJob"
done
echo "Success"
# env GOFLAGS="-mod=vendor" CGO_ENABLED=0 go test -p 1 -v ./... -run "^TestLock"