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

Spike/altered loading strategy #1349

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@luke-hill
Copy link
Contributor

commented May 3, 2019

Summary

Provide a way for cucumber to only load files once.

Details

Using a config switch, decide on whether cucumber should recurse through files potentially n times, or just once only.

Motivation and Context

This fixes an old problem here: #1043 - Where the user had procedural code which was being instantiated twice. A user should be able to specify the load order of a file, and "not" have the file loaded twice.

How Has This Been Tested?

Unit Tests have been added in the appropriate file.

Screenshots (if appropriate):

Types of changes

  • Refactor (code change that does not change external functionality)
  • 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.

Outstanding questions FYI: @mattwynne / @roberts1000

  • Should we use the top level config or the config level which requires flags.
  • How should we advertise this?
  • Is there anything missing?
@luke-hill

This comment has been minimized.

Copy link
Contributor Author

commented May 3, 2019

I've coded this in two slightly different ways in different SHA's. Will remove the one / both we like/dislike

@jaysonesmith

This comment has been minimized.

Copy link
Member

commented May 13, 2019

Nice work! WRT to your questions:

  • I think something like a --load-once flag could be suitable for invoking this.
  • If you're down for writing a blog post about the solution and how you did it, we could advertise it that way. :)
  • I saw that in Slack you said you were unsure if it was an issue for other languages: Is there any way you could find out? @mpkorstanje do you happen to know off-hand if this is something Java could benefit from as well?
@mpkorstanje

This comment has been minimized.

Copy link

commented May 13, 2019

No. We have nothing comparable in Java.

@alexJunger

This comment has been minimized.

Copy link

commented May 24, 2019

Is there a reason for keeping load, given that this will make it to the new major (I assume)?
If configurable, I think the non-default compatibility option should be load, not require.

@luke-hill

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2019

I think that whilst this will be in a new major cut, there was no notice of deprecations beforehand, and this is quite a big change to the autoloader. I would rather keep the default as is and add a new config for v4 and then for v5 alter / remove / switch the default

@mattwynne

This comment has been minimized.

Copy link
Member

commented May 30, 2019

Looks good to me @luke-hill and I second @jaysonesmith's suggestion of a blog post when we do the release. Just make sure the changelog is up to date when you merge so you/we know what to build the blog post around.

@luke-hill luke-hill force-pushed the spike/altered_loading_strategy branch from fa5a1e8 to af0417b Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.