Make database and library optional #86

Merged
wojtek merged 4 commits from 25---make-database-and-library-optional into main 2024-01-07 11:07:36 +01:00
Showing only changes of commit 115373667f - Show all commits

View File

@ -1,12 +1,17 @@
import argparse
import json
import sys
def main(coverage_file, fail_under):
with open(coverage_file, encoding="utf-8") as f:
coverage_json = json.load(f)
coverage = float(coverage_json["message"][:-1])
return coverage >= fail_under
print(f"Code coverage: {coverage:.2f}%; Threshold: {fail_under:.2f}%")
success = coverage >= fail_under
if coverage < fail_under:
print("Insufficient code coverage", file=sys.stderr)
return success
if __name__ == "__main__":