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

Output location of fn that matched the Step #221

Merged
merged 45 commits into from
Jul 25, 2022
Merged

Conversation

ilslv
Copy link
Member

@ilslv ilslv commented Jul 12, 2022

Synopsis

Often I find myself struggling to find fn, that matched the Step, especially to debug the failure.

Solution

Output step::Location of the fn that matched Step:

  • For every test case in writer::Libtest, in case --show-output option is enabled. Only for failed ones otherwise.
  • Only failed ones inside writer::Basic, writer::Json and writer::Junit

Checklist

  • Created PR:
    • In draft mode
    • Name contains Draft: prefix
    • Name contains issue reference
    • Has assignee
  • Documentation is updated (if required)
  • Tests are updated (if required)
  • Changes conform code style
  • CHANGELOG entry is added (if required)
  • FCM (final commit message) is posted
    • and approved
  • Review is completed and changes are approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • Draft: prefix is removed
    • All temporary labels are removed

ilslv added 18 commits July 7, 2022 11:33
# Conflicts:
#	CHANGELOG.md
#	README.md
#	book/src/introduction.md
#	book/src/output/json.md
#	book/src/output/junit.md
#	book/src/output/multiple.md
#	book/src/quickstart.md
#	book/src/writing/hooks.md
#	codegen/CHANGELOG.md
#	codegen/src/lib.rs
#	codegen/src/world.rs
#	src/codegen.rs
#	src/cucumber.rs
#	src/lib.rs
#	src/writer/summarize.rs
#	tests/after_hook.rs
#	tests/cli.rs
#	tests/json.rs
#	tests/junit.rs
#	tests/output.rs
#	tests/wait.rs
@ilslv ilslv added enhancement Improvement of existing features or bugfix semver::breaking Represents breaking changes labels Jul 12, 2022
@ilslv ilslv added this to the 0.14.0 milestone Jul 12, 2022
@ilslv ilslv self-assigned this Jul 12, 2022
@ilslv
Copy link
Member Author

ilslv commented Jul 12, 2022

FCM

Output location of `fn` matching a `Step` (#221)

Additionally:
- strip `CARGO_MANIFEST_DIR` from output paths whenever is possible

@ilslv ilslv requested a review from tyranron July 21, 2022 13:05
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

Discussed in voice:

  1. More clear error output like:

    Step failed
    Defined: tests/features/wait/nested/rule.feature:17:7
    Matched: tests/wait.rs:47:1
    
  2. Strip project root dir from .feature path, if possible.

  3. For libtest::Writer with --show-output show path for both .feature file and step function.

  4. Fix duplicated Intellij Rust .gif

@ilslv ilslv requested a review from tyranron July 22, 2022 11:54
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

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

@ilslv overall implementation is fine now. Just tests need correction.

tests/libtest/correct.stdout Outdated Show resolved Hide resolved
src/writer/libtest.rs Show resolved Hide resolved
src/writer/json.rs Outdated Show resolved Hide resolved
@ilslv ilslv requested a review from tyranron July 25, 2022 08:53
@tyranron tyranron merged commit ba47a18 into main Jul 25, 2022
@tyranron tyranron deleted the path-to-matched-step branch July 25, 2022 09:30
@tyranron tyranron added the k::UI/UX UI (user interface) and UX (user experience) changes label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::UI/UX UI (user interface) and UX (user experience) changes semver::breaking Represents breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants