File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 6
6
import json
7
7
import logging
8
8
import os
9
- import psutil
9
+ import re
10
10
import shlex
11
11
import sys
12
12
import urllib
19
19
import attrs
20
20
import lsprotocol .converters
21
21
import lsprotocol .types
22
+ import psutil
22
23
from drivers import ALSTestDriver
23
24
from e3 .os .process import Run , command_line_image
24
25
from e3 .testsuite .driver .classic import ProcessResult , TestAbortWithFailure
@@ -700,6 +701,24 @@ async def async_wrapper(
700
701
if assert_no_lsp_errors :
701
702
# Assert the absence of Error LSP log messages
702
703
client .assertNoLSPErrors ()
704
+ except Exception :
705
+ # In case of test failure in CI, include the ALS log file
706
+ if "CI" in os .environ and client :
707
+ LOG_FILE_PATTERN = r"Log file is: (.*)"
708
+ log_file_message = [
709
+ m
710
+ for m in client .log_messages
711
+ if re .search (LOG_FILE_PATTERN , m .message )
712
+ ]
713
+ if log_file_message :
714
+ m = re .search (LOG_FILE_PATTERN , log_file_message [0 ].message )
715
+ if m :
716
+ log_path = Path (m .group (1 ))
717
+ LOG .info (
718
+ "Content of log file %s:\n %s" ,
719
+ log_path ,
720
+ log_path .read_text (),
721
+ )
703
722
finally :
704
723
try :
705
724
if client :
You can’t perform that action at this time.
0 commit comments