Skip to content

feat(#377): list failing tests#397

Merged
felangel merged 7 commits intomainfrom
renan-377/list-failing-tests
May 20, 2022
Merged

feat(#377): list failing tests#397
felangel merged 7 commits intomainfrom
renan-377/list-failing-tests

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 requested a review from wolfenrain May 13, 2022 16:57
@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 renancaraujo force-pushed the renan-377/list-failing-tests branch from 1df0121 to 149c1c2 Compare May 16, 2022 10:42
@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 requested a review from felangel May 18, 2022 12:47
@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
@renancaraujo renancaraujo force-pushed the renan-377/list-failing-tests branch from f442f00 to 1bf7c98 Compare May 19, 2022 10:22
@renancaraujo renancaraujo force-pushed the renan-377/list-failing-tests branch from 1bf7c98 to ed280ec Compare May 19, 2022 10:44
wolfenrain
wolfenrain previously approved these changes May 19, 2022
@felangel
Copy link
Contributor

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

@renancaraujo renancaraujo force-pushed the renan-377/list-failing-tests branch from 7733842 to 167ce34 Compare May 20, 2022 08:43
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
ahsanf pushed a commit to Arkabyte-Teknologi/very_good_cli that referenced this pull request Aug 12, 2025
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.

3 participants