Skip to content

Commit

Permalink
Add debug logging to TRX processing
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Aug 16, 2022
1 parent 9a957d3 commit dcd48a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/publish/trx.py
@@ -1,3 +1,4 @@
import logging
import pathlib
from typing import Iterable, Callable

Expand All @@ -13,7 +14,12 @@ def parse_trx_files(files: Iterable[str],
progress: Callable[[ParsedJUnitFile], ParsedJUnitFile] = lambda x: x) -> Iterable[ParsedJUnitFile]:
"""Parses trx files."""
def parse(path: str) -> JUnitTree:
logger = logging.getLogger('publish')
logger.setLevel('DEBUG')
trx = etree.parse(path)
return transform_trx_to_junit(trx)
logger.debug(trx.tostring(encoding='utf8', method='xml'))
junit = transform_trx_to_junit(trx)
logger.debug(junit.tostring(encoding='utf8', method='xml'))
return junit

return progress_safe_parse_xml_file(files, parse, progress)
1 change: 1 addition & 0 deletions python/publish_test_results.py
Expand Up @@ -150,6 +150,7 @@ def main(settings: Settings, gha: GithubAction) -> None:

# get the unit test results
parsed = parse_files(settings, gha)
logger.debug(parsed)
log_parse_errors(parsed.errors, gha)

# process the parsed results
Expand Down

0 comments on commit dcd48a8

Please sign in to comment.