Skip to content

Commit 41bfcd9

Browse files
authored
Merge pull request #338 from espressif/fix/record-app_path-in-junit
fix: record app_path in junit reports
2 parents 88c955b + 8484ed6 commit 41bfcd9

File tree

13 files changed

+464
-270
lines changed

13 files changed

+464
-270
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# ruff, ruff-format
22
3f0008207d272b7fa4329d86a157f4533f1a441f
3+
a90b0d0c35a8e1c6896130e23c46cedee48b4158

pytest-embedded-arduino/tests/test_arduino.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def test_arduino_app(app, dut):
1717

1818
result = testdir.runpytest(
1919
'-s',
20-
'--embedded-services', 'arduino,esp',
21-
'--app-path', os.path.join(testdir.tmpdir, 'hello_world_arduino'),
22-
'--build-dir', 'build',
20+
'--embedded-services',
21+
'arduino,esp',
22+
'--app-path',
23+
os.path.join(testdir.tmpdir, 'hello_world_arduino'),
24+
'--build-dir',
25+
'build',
2326
)
2427

2528
result.assert_outcomes(passed=1)

pytest-embedded-idf/pytest_embedded_idf/unity_tester.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ def wrapper(self, *args, **kwargs):
288288
finally:
289289
_end_at = time.perf_counter()
290290
self._add_single_unity_test_case(
291-
_case, _log, additional_attrs={'time': round(_end_at - _start_at, 3)}
291+
_case,
292+
_log,
293+
additional_attrs={'app_path': self.app.app_path, 'time': round(_end_at - _start_at, 3)},
292294
)
293295

294296
return wrapper
@@ -695,6 +697,8 @@ def process_raw_report_data(self, raw_data_to_report) -> t.Dict:
695697
if log:
696698
attrs.update({'stdout': log})
697699

700+
attrs.update({'app_path': self.dut.app.app_path})
701+
698702
return attrs
699703

700704
def add_to_report(self, attrs):
@@ -765,9 +769,6 @@ def gather(self):
765769
for _t in self.workers:
766770
_t.close()
767771

768-
def get_processed_report_data(self, res: t.List[t.Any]) -> t.List[t.Dict]:
769-
return [self.workers[i].process_raw_report_data(res[i]) for i in range(len(res))]
770-
771772
@staticmethod
772773
def get_merge_data(test_cases_attr: t.List[t.Dict]) -> t.Dict:
773774
output = {}
@@ -794,6 +795,8 @@ def get_merge_data(test_cases_attr: t.List[t.Dict]) -> t.Dict:
794795
for k, val in output.items():
795796
if k in ('file', 'line'):
796797
output[k] = val[0]
798+
elif k == 'app_path':
799+
output[k] = '|'.join(val)
797800
else:
798801
output[k] = '<------------------->\n'.join(val)
799802

0 commit comments

Comments
 (0)