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

Add step location in case of datatable conversion error #2908

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

deblockt
Copy link
Contributor

🤔 What's changed?

Add step location in case of datatable conversion error

⚡️ What's your motivation?

The goal of this feature is to be able to identify easily the step when a dataTable conversion fail.
Previous this PR in case of conversion error, we have this type of error:

Step failed
java.lang.RuntimeException: This is an error
	at com.deblock.cucumber.TestStep.convert(TestStep.java:58)

By we don't know which step fail. With the new version, the error looks like

java.lang.RuntimeException: This is an error
	at com.deblock.cucumber.TestStep.convert(TestStep.java:58)
	at ✽.this is a test(file:///..../test.feature:4)

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@mpkorstanje mpkorstanje changed the title feat: add step location in case of datatable conversion error Add step location in case of datatable conversion error Jul 21, 2024
Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

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

Cheers! Looks good. One minor request in the comments below.

Please also add a new ### Fixed header to change log with a description of this change.

@@ -257,11 +258,15 @@ void rethrows_target_invocation_exceptions_from_parameter_type() {
StepExpression expression = stepExpressionFactory.createExpression(stepDefinition);
CoreStepDefinition coreStepDefinition = new CoreStepDefinition(id, stepDefinition, expression);
List<Argument> arguments = coreStepDefinition.matchedArguments(step);
StepDefinitionMatch stepDefinitionMatch = new PickleStepDefinitionMatch(arguments, stepDefinition, null, step);
StepDefinitionMatch stepDefinitionMatch = new PickleStepDefinitionMatch(arguments, stepDefinition,
new URI("test.feature"), step);
Copy link
Contributor

Choose a reason for hiding this comment

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

URI.create then the throws can be omitted. Here and all others.

@deblockt
Copy link
Contributor Author

Hi @mpkorstanje .

Thanks for your review. I've taken your comments into account.

@mpkorstanje mpkorstanje merged commit 64af5a3 into cucumber:main Jul 22, 2024
6 checks passed
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