Skip to content

add unit test stdout (error details) to renderFailed state#145

Merged
NejcS merged 8 commits intomainfrom
feat/show_unrecoverable_test_error_details
Apr 2, 2026
Merged

add unit test stdout (error details) to renderFailed state#145
NejcS merged 8 commits intomainfrom
feat/show_unrecoverable_test_error_details

Conversation

@NejcS
Copy link
Copy Markdown
Contributor

@NejcS NejcS commented Mar 31, 2026

#95
This makes some small changes for the render failed screen:

  • It doesn't show the error 69 in case of the unrecoverable error.
  • It shows the error message that the test scripts output.
  • If the user used clear command in the test scripts, only the output after the clearing will be shown in the render failed screen.
  • The displayed paths for the provided unit and conformance tests scripts are normalized (/a/b/../../c -> /c)
  • The changes apply for both unit tests and conformance tests.

Before:
image

After (unit tests):
Screenshot 2026-04-01 at 15 59 12

After (conformance tests):
Screenshot 2026-04-01 at 15 58 03

@NejcS NejcS self-assigned this Mar 31, 2026
@NejcS NejcS requested review from dusano and pedjaradenkovic March 31, 2026 13:54
@NejcS NejcS marked this pull request as ready for review March 31, 2026 13:54
@NejcS NejcS requested a review from zanjonke April 1, 2026 06:27
Copy link
Copy Markdown
Contributor

@pedjaradenkovic pedjaradenkovic left a comment

Choose a reason for hiding this comment

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

As discussed, try to process the input run scripts paths so that it prints the clear absolute path (without relative parts)

stdout = ""
elapsed_time = time.time() - start_time

erase_display_pattern = re.compile(r"(?:\033\[[^a-zA-Z]*[a-zA-Z])*\033\[2J(?:\033\[[^a-zA-Z]*[a-zA-Z])*")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest extracting this to a separate method with clear explanation what it does.

Also, probably good idea is to extract the regex pattern into a constant.

@NejcS NejcS requested a review from pedjaradenkovic April 1, 2026 14:03
@NejcS
Copy link
Copy Markdown
Contributor Author

NejcS commented Apr 1, 2026

@pedjaradenkovic I did the requested changes then I remembered we probably want the same for the conformance tests. Please recheck.

Copy link
Copy Markdown
Contributor

@pedjaradenkovic pedjaradenkovic left a comment

Choose a reason for hiding this comment

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

Great work 🚀

Before merging don't forget to squash the commits. Congrats on first solved ticket :D

proc.kill()


def sanitize_script_output(script_output: str) -> str:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Start it with _ to indicate is a private.

@NejcS
Copy link
Copy Markdown
Contributor Author

NejcS commented Apr 2, 2026

Great work 🚀

Before merging don't forget to squash the commits. Congrats on first solved ticket :D

Thanks :)

@NejcS NejcS merged commit 5342b63 into main Apr 2, 2026
10 checks passed
@NejcS NejcS deleted the feat/show_unrecoverable_test_error_details branch April 2, 2026 05:41
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