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

feat(#377): list failing tests #397

Merged
merged 7 commits into from
May 20, 2022
Merged

feat(#377): list failing tests #397

merged 7 commits into from
May 20, 2022

Conversation

renancaraujo
Copy link
Contributor

Description

Adds a listing of failing tests after a test run as proposed on #377

Screenshot 2022-05-13 at 17 52 10

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@renancaraujo renancaraujo marked this pull request as draft May 13, 2022 16:58
return previousValue;
},
);
stdout(lines.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awesome!
Should we log them via stderr? Also what about if test descriptions are really long? Do we want to handle truncating or just let the names wrap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to output the suite paths. I see no problem on wrapping them. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also changed to output via stderr. I was going to wrap everything on red but since the Logger.error does that for us, it was not necessary.

@renancaraujo
Copy link
Contributor Author

Changed it to have an output including line and column, as well as the path of to the suite.
The only problem is that the suite is always identified as ./test/.test_runner.dart when optimization is on (default).

Without optimization, the output is:

Failing Tests:
 - <path to cwd>/test/src/widgets/the_real_test_file.dart:30:5

With optimization, the output is:

Failing Tests:
 - <path to cwd>/test/.test_runner.dart:30:5

@renancaraujo renancaraujo force-pushed the renan-377/list-failing-tests branch 2 times, most recently from bef33d7 to f442f00 Compare May 19, 2022 10:20
@renancaraujo
Copy link
Contributor Author

Update: Changed to retrieve the test location from the stack trace. In this way, the right path is recovered regardless of the optimization being true of false .
Also added a prefix to show if the test failed or resulted in an error:

Failing Tests:
 - [FAILED] test/example_test.dart 4:5
 - [ERROR] test/example_test.dart 5:5

@renancaraujo renancaraujo marked this pull request as ready for review May 19, 2022 10:22
wolfenrain
wolfenrain previously approved these changes May 19, 2022
@felangel
Copy link
Contributor

Screen Shot 2022-05-19 at 10 15 08 AM

Copy link
Contributor

@felangel felangel left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@felangel felangel merged commit d229c5e into main May 20, 2022
@felangel felangel deleted the renan-377/list-failing-tests branch May 20, 2022 15:26
@felangel felangel mentioned this pull request May 20, 2022
7 tasks
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.

None yet

3 participants