richardmiller-zz / BehatSpec

Extensions to integrate Behat and PhpSpec
MIT License
51 stars 6 forks source link

Supporting phpspec 3 and Behat 3.2 #5

Open richardmiller-zz opened 8 years ago

richardmiller-zz commented 8 years ago

@pocky @docteurklein I'm going to look at getting the phpspec extension parts of BehatSpec working with phpspec 3, there is also the forthcoming change to Behat that should get rid of the need for ErrorExtension and that will also need some changes in BehatPhpspecExtension.

I'm not sure it will be possible to do all of this without branching various repos and then having branches of this one to support the different dependencies. I think it's also worth considering a stable release for the version that depends on Behat 3.2 once released and the hackier error handling can be removed. What are your thoughts on how best to approach these changes?

docteurklein commented 8 years ago

@richardmiller that's an excellent question. What about committing on master, but with a composer.json requiring behat/behat:^3.2 ? (same for other deps).

This way we wouldn't have to maintain branch spaghetti, and we would let composer handle the resolution.

Not even sure it would work :)

richardmiller-zz commented 8 years ago

I would really like to avoid branch spaghetti, would your approach just mean forcing the latest versions of behat and phpspec if you use the latest version of this and associated extensions? Given they are dev tools and someone can fall back to an old tag if they must have older versions then I think this could be ok.

docteurklein commented 8 years ago

Yeah, the idea is that composer will choose the only possible choice depending on the constraints you have. Let's imagine some scenarios:

  1. user has no constraint (or behat 3.2)
    • he runs composer require rmiller/behatspec
    • composer installs latest versions (behat 3.2 and latest behatspec)
  2. user has behat 3.1
    • he runs composer require rmiller/behatspec
    • composer installs the latest compatible version with behat 3.1 (which is the previous version)

The same scenarios can be applied with phpspec. If we put the correct constraints in our composer.json requirements, we can delegate everything to composer dependency resolver!

ciaranmcnulty commented 8 years ago

Why not make this a monorepo and turn the other extensions into subtree splits?

ciaranmcnulty commented 7 years ago

Do you need any help with this?

richardmiller-zz commented 7 years ago

What are the benefits of doing that? The main possible problem we may have is having to support various versions of behat and phpspec, will a monorepo help with that?

ciaranmcnulty commented 7 years ago

Monorepo would make coordinated change across the repos (when new versions come out) easier.

pocky commented 7 years ago

@richardmiller Sorry for the delay, I think both ideas (monorepo and behat/phpspec integration) are great so I did a PR.

ek9 commented 7 years ago

Hey guys, any plans to release this? Possible the monorepo migration could be done separately, so we can have the PHPSpec3 support? I'd be willing to help with any needed PRs, please let me know.

richardmiller-zz commented 7 years ago

@ek9 there is plan here #13. Is there is anything you can help with that would be great. Sorry for the delay

ek9 commented 7 years ago

From my recent tests (in the past day) I believe the basic functionality is working correctly for the new versions after the subsplit merge + the namepsace fix ( #25 ) . Once all the tests are in one place ( #27 ) we can verify this by tests too and hopefully close this as basic support for phpspec 3 / Behat 3.2 is there.

I would then suggest to make a few more specific issues on what needs to be done before considering doing a stable release.

ek9 commented 7 years ago

I've made some issues and pulled some PRs for you to review / merge which should finalize most of the things. Please review / merge in this order to avoid conflicts:

Once this is ready to use I would suggest to cleanup the versions that do not work and do 0.6.0 / 0.6.x-dev #32

Otherwise I think this issue can be closed as main changes were done and we have separate issues for other tasks.

richardmiller-zz commented 7 years ago

One of the other changes, is that Behat 3.2 has it's own error listeners which can be used instead of the ones in the ErrorExtension. These should work better as well in terms of hopefully solving one of the issues with the way the current error observers work (https://github.com/richardmiller/ErrorExtension/issues/1)

ek9 commented 7 years ago

Good point, I've made #40 issue for this.

Dragonrun1 commented 5 years ago

So it's now almost 2 years later and Behat is now on v3.5 and PHPSpec is on v5.1 and this still doesn't work so can we get an update at least of when it will?