Skip to content

Commit

Permalink
Merge pull request #262 from espressif/ci/fix_missing_message_attr_in…
Browse files Browse the repository at this point in the history
…_failure_nodes
  • Loading branch information
hfudev authored Jan 22, 2024
2 parents ef12553 + 2f28586 commit 377d478
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
We use [pre-commit](https://pre-commit.com) for code formatting, and some linter checks. You can install it by

```shell
$ pre-commit install
$ pre-commit install -t pre-commit -t commit-msg
```

We use [commitizen](https://github.com/commitizen-tools/commitizen) to auto generate the [CHANGELOG.md](./CHANGELOG.md).
Expand Down
18 changes: 14 additions & 4 deletions pytest-embedded-idf/pytest_embedded_idf/unity_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,15 @@ def _add_single_unity_test_case(

# real parsing
if len(res) == 0:
logging.warning(f'unity test case not found, use case {case.name} instead')
attrs = {'name': case.name, 'result': 'FAIL', 'message': self.pexpect_proc.buffer_debug_str}
logging.warning(
'unity test case not found, probably due to a timeout. Assume the current test case is "%s"',
case.name,
)
attrs = {
'name': case.name,
'result': 'FAIL',
'message': self.pexpect_proc.buffer_debug_str or 'timeout',
}
elif len(res) == 1:
attrs = {k: v for k, v in res[0].groupdict().items() if v is not None}
else:
Expand Down Expand Up @@ -611,11 +618,14 @@ def process_raw_report_data(self, raw_data_to_report) -> t.Dict:

# real parsing
if len(res) == 0:
logging.warning(f'unity test case not found, use case {self.case.name} instead')
logging.warning(
'unity test case not found, probably due to a timeout. Assume the current test case is "%s"',
self.case.name,
)
attrs = {
'name': self.case.name,
'result': 'FAIL',
'message': self.dut.pexpect_proc.buffer_debug_str,
'message': self.dut.pexpect_proc.buffer_debug_str or 'timeout',
'time': time.perf_counter() - self.init_time,
}
elif len(res) == 1:
Expand Down

0 comments on commit 377d478

Please sign in to comment.