Skip to content

Improve test case failure/skip states and their output (#4116)#4129

Merged
gcampbell-msft merged 4 commits intomicrosoft:mainfrom
redstrate:better-test-output
Nov 11, 2024
Merged

Improve test case failure/skip states and their output (#4116)#4129
gcampbell-msft merged 4 commits intomicrosoft:mainfrom
redstrate:better-test-output

Conversation

@redstrate
Copy link
Contributor

This change addresses item #4116

This changes visible test output

The following changes are proposed:

  • Change the test output message when encountering an error exit code.
  • Check for skipped tests and mark them as skipped.

The purpose of this change

Currently if a test fails, it's not immediately clear why that is because we give the exit code - and not the output from ctest. That is now fixed and the ctest output is shown which greatly improves the usefulness of the Test Results pane and other places where this output is shown like Code Lens.

Skipped test cases were also not actually marked as skipped, and that is now fixed as well.

Other Notes/Information

Comparison screenshots to show the improvement:

Failed Tests

Before After
Screenshot_20241015_125716 Screenshot_20241015_125209

Skipped Tests

Before After
Screenshot_20241015_125700 Screenshot_20241015_125759

Unfortunately this google test example I used doesn't set test source location, but if it did then code lens would be affected as well like in this outdated screenshot from the issue:

image

@redstrate
Copy link
Contributor Author

@microsoft-github-policy-service agree company="KDAB"

Copy link
Collaborator

@gcampbell-msft gcampbell-msft left a comment

Choose a reason for hiding this comment

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

@redstrate This looks great!

If you could please make a CHANGELOG entry, then we can approve and accept this PR! Thanks.

@redstrate
Copy link
Contributor Author

@redstrate This looks great!

If you could please make a CHANGELOG entry, then we can approve and accept this PR! Thanks.

Done!

Currently if a test fails, it's not immediately clear why that is
because we give the exit code - and not the output from ctest. That is
now fixed and the ctest output is shown which greatly improves the
usefulness of the Test Results pane and other places where this output
is shown like Code Lens.

Skipped test cases were also not actually marked as skipped, and that is
now fixed as well.
@gcampbell-msft gcampbell-msft enabled auto-merge (squash) October 17, 2024 12:49
Copy link
Collaborator

@gcampbell-msft gcampbell-msft left a comment

Choose a reason for hiding this comment

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

See other comments.

@gcampbell-msft gcampbell-msft merged commit 12ea80d into microsoft:main Nov 11, 2024
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.

Test output isn't visible when failed

2 participants