Skip to content

Skip test step execution if --dry-run is specified #1220

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

Merged
merged 3 commits into from
Sep 13, 2017

Conversation

adrian-baker
Copy link

@adrian-baker adrian-baker commented Sep 9, 2017

Summary

Details

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@adrian-baker adrian-baker changed the title Skip test step execution if --dry-run is specified (#1219) Skip test step execution if --dry-run is specified Sep 9, 2017
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.

Hi! Thanks for the bug report. I don't think this is the proper solution though.

Test cases are created in Runner#createTestCaseForPickle. Rather then passing the dry-run flag between components it can be given to the TestCase right away through its constructor.

@@ -84,6 +84,25 @@ public void hooks_execute_also_after_failure() throws Throwable {
}

@Test
public void steps_are_not_executed_on_dry_run() throws Throwable {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test verifies two things. I think it should make into two tests.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 56.209% when pulling a55d049 on adrian-baker:master into a3f847b on cucumber:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 56.209% when pulling a412da3 on adrian-baker:master into a3f847b on cucumber:master.


public TestCase(List<TestStep> testSteps, PickleEvent pickleEvent) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is an api package, should the ctor with the current signature be kept for backward compatibility? @mpkorstanje WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Along with adding a deprecation tag that would be the correct course of of action.

In the long run (and I'm only just starting to think about this) I'd like TestCase to be an interface so we can exclude the constructors and run method from the public api. These methods aren't needed as part of the event bus protocol.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we push this as a extra commit on this feature branch so we don't have to bother Adrian with this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't. Permissions have apparently not been set.

Copy link
Contributor

@mpkorstanje mpkorstanje Sep 12, 2017

Choose a reason for hiding this comment

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

I've pushed my suggested changes to #1223. I reckon we can finish up this discussion the PR for that branch. I've got no further objections to this branch being merged.

Copy link
Author

Choose a reason for hiding this comment

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

Great, thanks. Yes wasn't comfortable with having to change an api package, but in the current state didn't seem avoidable.

@mpkorstanje mpkorstanje merged commit 442922b into cucumber:master Sep 13, 2017
@aslakhellesoy
Copy link
Contributor

Hi @adrian-baker,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

brasmusson added a commit that referenced this pull request Sep 14, 2017
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants