Skip to content

Commit 5804aa7

Browse files
committed
added exitcode to collection
1 parent 65535da commit 5804aa7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pytask_vscode/execution.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
def pytask_collect_log(session: pytask.Session, reports: list[pytask.CollectionReport], tasks: list[pytask.PTask]) -> None:
99
try:
1010
if session.config['command'] == 'collect':
11+
exitcode = 0
12+
for report in reports:
13+
if report.outcome == pytask.CollectionOutcome.FAIL:
14+
exitcode = 3
1115
result = [{'name' : task.name.split('/')[-1], 'path' : str(task.path)} if isinstance(task,pytask.PTaskWithPath) else {'name' : task.name, 'path' : ''} for task in tasks]
12-
res = requests.post('http://localhost:6000/pytask', json={"exitcode" : session.exit_code, "tasks": result}, timeout=0.0001)
16+
res = requests.post('http://localhost:6000/pytask', json={"exitcode" : exitcode, "tasks": result}, timeout=0.0001)
1317
except requests.exceptions.ReadTimeout:
1418
pass
1519
except Exception as e:

0 commit comments

Comments
 (0)