summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-07-20 20:41:14 +0300
committerLars Wirzenius <liw@liw.fi>2023-07-20 20:43:48 +0300
commitaa43087b6ac8e9d1edfb95a4164bf4dbc4ecb5fa (patch)
tree44a2b60c0f6313f99129bae9a188cf3ad44f7370 /check
parent7bb4e0f3bc05315c90f6d89552aa13658250e118 (diff)
downloadsubplot-aa43087b6ac8e9d1edfb95a4164bf4dbc4ecb5fa.tar.gz
feat(check): allow offline tests
Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck10
1 files changed, 8 insertions, 2 deletions
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: