From aa43087b6ac8e9d1edfb95a4164bf4dbc4ecb5fa Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 20 Jul 2023 20:41:14 +0300 Subject: feat(check): allow offline tests Sponsored-by: author --- check | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'check') diff --git a/check b/check index 7e2e9b5..710232c 100755 --- a/check +++ b/check @@ -13,9 +13,10 @@ from subprocess import PIPE, DEVNULL, STDOUT class Runcmd: """Run external commands in various ways""" - def __init__(self, verbose, progress): + def __init__(self, verbose, progress, offline): self._verbose = verbose self._progress = progress + self.offline = offline # Deliberately chosen because it's 12:45 / 13:45 offset from UTC # As such it ought to show any TZ related errors if we're lucky. self._env = {"TZ": "NZ-CHAT"} @@ -267,6 +268,8 @@ def check_subplots(r): "**/*.subplot", lambda f: f == f.lower() and "subplotlib" not in f and "test-outputs" not in f, ) + if r.offline: + subplots = [s for s in subplots if s != "reference.subplot"] for subplot0 in subplots: r.title(f"checking subplot {subplot0}") @@ -364,6 +367,9 @@ def parse_args(): p.add_argument( "--sloppy", action="store_true", help="don't check formatting or with clippy" ) + p.add_argument( + "--offline", action="store_true", help="only run tests that can be run offline" + ) all_whats = ["tooling", "python", "shell", "rust", "subplots"] p.add_argument( @@ -386,7 +392,7 @@ def main(): """Main program""" args = parse_args() - r = Runcmd(args.verbose, args.progress) + r = Runcmd(args.verbose, args.progress, args.offline) r.setenv("PYTHONDONTWRITEBYTECODE", "1") for what in args.what: -- cgit v1.2.1