mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 01:54:49 +00:00
refactor(ci): consolidate Python test phase dispatch (#16120)
This commit is contained in:
1 parent
0f464ddd7e
commit
dba1a371b5
1 file changed
+12
-18
+12
-18
@@ -107,23 +107,17 @@ if not list(root.joinpath("tests/support/analysis-efficiency").glob("test_*.py")
|
||||
modules = [
|
||||
".".join(path.relative_to(root).with_suffix("").parts) for path in bridge_tests
|
||||
]
|
||||
if sys.argv[1:] == ["--bridge"]:
|
||||
run_bridge(modules)
|
||||
phases = {
|
||||
"--bridge": lambda: run_bridge(modules),
|
||||
"--analysis-efficiency": run_analysis_efficiency,
|
||||
}
|
||||
args = sys.argv[1:]
|
||||
if len(args) == 1 and args[0] in phases:
|
||||
phases[args[0]]()
|
||||
raise SystemExit(0)
|
||||
if sys.argv[1:] == ["--analysis-efficiency"]:
|
||||
run_analysis_efficiency()
|
||||
raise SystemExit(0)
|
||||
if sys.argv[1:]:
|
||||
if args:
|
||||
fail("invalid_python_test_arguments")
|
||||
bridge_result = subprocess.run(
|
||||
[sys.executable, __file__, "--bridge"], cwd=root, check=False
|
||||
)
|
||||
if bridge_result.returncode:
|
||||
sys.exit(bridge_result.returncode)
|
||||
result = subprocess.run(
|
||||
[sys.executable, __file__, "--analysis-efficiency"],
|
||||
cwd=root,
|
||||
check=False,
|
||||
)
|
||||
if result.returncode:
|
||||
sys.exit(result.returncode)
|
||||
for phase in phases:
|
||||
result = subprocess.run([sys.executable, __file__, phase], cwd=root, check=False)
|
||||
if result.returncode:
|
||||
sys.exit(result.returncode)
|
||||
Reference in new issue
Block a user