Skip to content

Commit ee9c03c

Browse files
committed
Ignore trace stats file in fmt command
The command was failing for snapshot directories containing both trace and trace stats snapshots because it assumes that all json files are trace snapshots. Just ignore the trace stats snapshots for now.
1 parent 1ea0020 commit ee9c03c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ddapm_test_agent/fmt.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,18 @@ def main(args: Optional[List[str]] = None) -> None:
8181
resolved_files = _resolve_files(parsed_args.files)
8282
log.info("Found %d snapshot files to process", len(resolved_files))
8383

84+
trace_files = []
85+
trace_stats_files = []
86+
for f in resolved_files:
87+
if f.endswith("_tracestats.json"):
88+
trace_stats_files.append(f)
89+
else:
90+
trace_files.append(f)
91+
log.info("Found %d trace snapshot files to process", len(trace_files))
92+
log.info("Found %d trace stats snapshot files to process", len(trace_stats_files))
93+
8494
has_errors = False
85-
for fname in resolved_files:
95+
for fname in trace_files:
8696
log.debug("Checking snapshot file %r", fname)
8797
try:
8898
# Read the original file data
@@ -107,7 +117,7 @@ def main(args: Optional[List[str]] = None) -> None:
107117
log.info("Snapshot file %r was formatted", fname)
108118

109119
except Exception:
110-
log.error("Error processing file %r", fname)
120+
log.exception("Error processing file %r", fname)
111121
has_errors = True
112122

113123
if has_errors:

0 commit comments

Comments
 (0)