66list all suites, tiers, lanes, variants
77show <name> a suite's resolved command per variant
88run <name> [opts] [-- ...] run one suite (the call CI + just both make)
9- matrix [--lane|--tier] JSON matrix `include` for GitHub Actions
9+ matrix [--lane|--tier|--suite] JSON matrix `include` for GitHub Actions
1010doctor validate the manifest (CI lints this)
1111"""
1212
1313from __future__ import annotations
1414
1515import argparse
1616import json
17+ import re
1718import sys
1819
1920from .runner import REPO_ROOT , describe , junit_path , matrix , run_suite , select
@@ -26,9 +27,10 @@ def _cmd_list(_: argparse.Namespace) -> int:
2627 f"{ 'SUITE' .ljust (width )} TIER LANES VARIANTS PLATFORMS"
2728 )
2829 for s in SUITES :
30+ lane_display = "manual" if s .manual else "," .join (s .lanes )
2931 print (
3032 f"{ s .name .ljust (width )} { s .tier :<4} "
31- f"{ ',' . join ( s . lanes ) :<21} { ',' .join (s .variants ):<15} { ',' .join (s .platforms )} "
33+ f"{ lane_display :<21} { ',' .join (s .variants ):<15} { ',' .join (s .platforms )} "
3234 )
3335 print (
3436 f"\n { len (SUITES )} suites. "
@@ -39,7 +41,8 @@ def _cmd_list(_: argparse.Namespace) -> int:
3941
4042def _cmd_show (args : argparse .Namespace ) -> int :
4143 s = by_name (args .name )
42- print (f"# { s .name } (tier={ s .tier } , lanes={ ',' .join (s .lanes )} )" )
44+ lane_display = "manual" if s .manual else "," .join (s .lanes )
45+ print (f"# { s .name } (tier={ s .tier } , lanes={ lane_display } )" )
4346 for var in s .variants :
4447 print (f"\n ## variant: { var } junit: { junit_path (s ).name } " )
4548 print (describe (s , var ))
@@ -100,6 +103,7 @@ def _cmd_matrix(args: argparse.Namespace) -> int:
100103 include = matrix (
101104 lane = args .lane ,
102105 tier = args .tier ,
106+ names = [args .suite ] if args .suite else None ,
103107 variant = args .variant ,
104108 platform = args .platform ,
105109 changed = _read_changed (args ),
@@ -112,7 +116,7 @@ def _cmd_matrix(args: argparse.Namespace) -> int:
112116
113117def _cmd_doctor (_ : argparse .Namespace ) -> int :
114118 """Static checks CI can gate on: unique names, unique junit paths, valid setup
115- steps, declared cwd dirs exist, every suite is reachable by some lane."""
119+ steps, declared cwd dirs exist, and scheduled suites have at least one lane."""
116120 problems : list [str ] = []
117121 names = [s .name for s in SUITES ]
118122 dupes = {n for n in names if names .count (n ) > 1 }
@@ -129,7 +133,9 @@ def _cmd_doctor(_: argparse.Namespace) -> int:
129133 for step in s .setup :
130134 if step not in valid_setup :
131135 problems .append (f"{ s .name } : unknown setup step { step !r} " )
132- if not s .lanes :
136+ if s .manual and s .lanes :
137+ problems .append (f"{ s .name } : manual suite must not belong to a lane" )
138+ if not s .manual and not s .lanes :
133139 problems .append (f"{ s .name } : belongs to no lane" )
134140 if not s .variants :
135141 problems .append (f"{ s .name } : runs on no variant" )
@@ -142,7 +148,33 @@ def _cmd_doctor(_: argparse.Namespace) -> int:
142148 if var not in (s .overrides .keys () | {"standard" , "rtx" }):
143149 problems .append (f"{ s .name } : bad variant { var !r} " )
144150
145- # Every suite should be exercised by some lane and some tier path.
151+ # TRT contract markers imply membership in the manual trt-api umbrella.
152+ # Keep this structural so doctor can run without importing torch/TRT or
153+ # collecting GPU tests.
154+ trt_suite = by_name ("trt-api" )
155+ trt_root = REPO_ROOT / trt_suite .cwd
156+ trt_paths = tuple (trt_root / path .rstrip ("/" ) for path in trt_suite .paths )
157+ contract_markers = ("trt_api" , "trt_rtx_only" )
158+ for test_file in (REPO_ROOT / "tests/py" ).rglob ("test_*.py" ):
159+ source = test_file .read_text (encoding = "utf-8" )
160+ used_trt_markers = set (re .findall (r"pytest\.mark\.(trt_[a-z0-9_]+)" , source ))
161+ unsupported = used_trt_markers .difference (contract_markers )
162+ if unsupported :
163+ problems .append (
164+ f"{ test_file .relative_to (REPO_ROOT )} : unsupported fine-grained "
165+ f"TRT markers { sorted (unsupported )} "
166+ )
167+ if not any (f"pytest.mark.{ marker } " in source for marker in contract_markers ):
168+ continue
169+ if not any (
170+ test_file == path or (path .is_dir () and path in test_file .parents )
171+ for path in trt_paths
172+ ):
173+ problems .append (
174+ f"{ test_file .relative_to (REPO_ROOT )} : TRT API contract test is "
175+ "not included in trt-api"
176+ )
177+
146178 if problems :
147179 for p in problems :
148180 print (f"✗ { p } " , file = sys .stderr )
@@ -199,6 +231,11 @@ def main(argv: list[str] | None = None) -> int:
199231 g = sp .add_mutually_exclusive_group ()
200232 g .add_argument ("--lane" , choices = ("fast" , "full" , "nightly" , "python-only" ))
201233 g .add_argument ("--tier" , choices = ("l0" , "l1" , "l2" ))
234+ g .add_argument (
235+ "--suite" ,
236+ choices = tuple (s .name for s in SUITES ),
237+ help = "select one named suite, including a manual suite" ,
238+ )
202239 sp .add_argument ("--variant" , choices = ("standard" , "rtx" ))
203240 sp .add_argument ("--platform" , choices = ("linux-x86_64" , "windows" ))
204241 sp .add_argument (
0 commit comments