From f7deb02f5b46d7160e89a0a6906d8baf02ed0fe2 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 11 Jun 2025 20:10:23 +0200 Subject: [PATCH] Fail if schema test coverage is below 100% --- scripts/schema-test-coverage.mjs | 4 ++++ scripts/schema-test-coverage.sh | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/scripts/schema-test-coverage.mjs b/scripts/schema-test-coverage.mjs index f343196c4e..0b2050ea60 100644 --- a/scripts/schema-test-coverage.mjs +++ b/scripts/schema-test-coverage.mjs @@ -131,3 +131,7 @@ console.log( allLocations.length, "(" + Math.floor((visitedLocations.size / allLocations.length) * 100) + "%)", ); + +if (visitedLocations.size != allLocations.length) { + process.exitCode = 1; +} \ No newline at end of file diff --git a/scripts/schema-test-coverage.sh b/scripts/schema-test-coverage.sh index cdd746f06e..825a254e26 100755 --- a/scripts/schema-test-coverage.sh +++ b/scripts/schema-test-coverage.sh @@ -6,8 +6,13 @@ [[ ! -e src/schemas ]] && exit 0 +branch=$(git branch --show-current) + echo echo "Schema Test Coverage" echo node scripts/schema-test-coverage.mjs src/schemas/validation/schema.yaml tests/schema/pass +rc=$? + +[[ "$branch" == "dev" ]] || exit $rc