Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(unity): make single board test procedure more robust #248

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

hfudev
Copy link
Member

@hfudev hfudev commented Dec 22, 2023

No description provided.

@hfudev hfudev self-assigned this Dec 22, 2023
@hfudev hfudev force-pushed the fix/make_run_all_single_board_cases_more_robust branch from 6a60ba0 to f8b6d21 Compare December 22, 2023 09:04
@hfudev hfudev requested a review from horw December 22, 2023 09:23
try:
self._hard_reset_func()
except NotImplementedError:
# since menu printed but been expected (buffer has gone)... ignore the first ready pattern
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very useful!
By the way, I think we don't need the self._ignore_first_ready_pattern attribute, do we?
We can simply press enter every time before expecting. As I see it, it will work the same way.

def _hard_reset(self) -> None:
    if self._hard_reset_func:
        try:
            self._hard_reset_func()
        except NotImplementedError:
            pass
def _get_ready(self, timeout: float = 30) -> None:
   self.confirm_write('\n', expect_pattern=READY_PATTERN_LIST, timeout=timeout)

Copy link
Member Author

@hfudev hfudev Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you're right. the downside of this approach is that, the test menu will be printed again after a reset.

I'd like to keep the code more complicated... and as an exchange, a cleaner output for users.

@hfudev
Copy link
Member Author

hfudev commented Dec 29, 2023

Since the error that this PR is fixing is not 100% reproducible, I'll merge it first :D

@hfudev hfudev merged commit a29bfd8 into main Dec 29, 2023
4 of 5 checks passed
@hfudev hfudev deleted the fix/make_run_all_single_board_cases_more_robust branch December 29, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants