mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-22 03:16:43 +00:00
Move away from dbmate, use PolySchema
This commit is contained in:
1 parent
52399c42f1
commit
2a14f3f84c
99 files changed
+1583
-1691
No files matched your search
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
export RED='\E[1;31m'
|
||||
export YELLOW='\E[1;33m'
|
||||
export RESET='\033[0m'
|
||||
|
||||
cd -- "$(dirname -- "$0")/.." || exit 1
|
||||
|
||||
if ! command -v go-test-coverage &>/dev/null; then
|
||||
echo -e "${YELLOW}Installing go-test-coverage ...${RESET}"
|
||||
go install github.com/vladopajic/go-test-coverage/v2@latest
|
||||
fi
|
||||
|
||||
if ! command -v tparse &>/dev/null; then
|
||||
echo -e "${YELLOW}Installing tparse ...${RESET}"
|
||||
go install github.com/mfridman/tparse@latest
|
||||
fi
|
||||
|
||||
if ! command -v go-junit-report &>/dev/null; then
|
||||
echo -e "${YELLOW}Installing go-junit-report ...${RESET}"
|
||||
go install github.com/jstemmer/go-junit-report/v2@latest
|
||||
fi
|
||||
|
||||
trap cleanup EXIT
|
||||
cleanup() {
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo -e "${RED}UNIT TESTING FAILED - check output and consider minimum coverage requirements${RESET}"
|
||||
fi
|
||||
rm -f coverage.out
|
||||
}
|
||||
|
||||
mkdir -p ../test/results/html-reports ../test/results/junit
|
||||
go test -json -cover -coverprofile="./coverage.out" ./... | tparse || true
|
||||
go tool cover -html="./coverage.out" -o "../test/results/html-reports/backend-coverage.html"
|
||||
go test -v -covermode=atomic ./... 2>&1 | go-junit-report >../test/results/junit/backend.xml
|
||||
|
||||
# this enforces minimum coverage requirements
|
||||
go-test-coverage -c .testcoverage.yml
|
||||
Reference in new issue
Block a user