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 66import json
77import logging
88import os
9- import psutil
9+ import re
1010import shlex
1111import sys
1212import urllib
1919import attrs
2020import lsprotocol .converters
2121import lsprotocol .types
22+ import psutil
2223from drivers import ALSTestDriver
2324from e3 .os .process import Run , command_line_image
2425from e3 .testsuite .driver .classic import ProcessResult , TestAbortWithFailure
@@ -700,6 +701,24 @@ async def async_wrapper(
700701 if assert_no_lsp_errors :
701702 # Assert the absence of Error LSP log messages
702703 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+ )
703722 finally :
704723 try :
705724 if client :
You can’t perform that action at this time.
0 commit comments