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

Register extensions via CLI #4131

Closed
Jean85 opened this issue Mar 5, 2020 · 5 comments
Closed

Register extensions via CLI #4131

Jean85 opened this issue Mar 5, 2020 · 5 comments

Comments

@Jean85
Copy link
Contributor

@Jean85 Jean85 commented Mar 5, 2020

Hi there. I'm the maintainer of https://github.com/facile-it/paraunit/, which is a tool that runs PHPunit tests in parallel.

In the past, I've used a printer as a way to obtain results from PHPUnit subrocesses; it doesn't seem a perfect way so, while working on PHPUnit 9 support for Paraunit, I've tried to migrate towards using TestHooks.

They seem great, but I'm lacking a single thing: I cannot inject them without touching the XML config file. This isn't ideal for me, because to do that I would need to change the XML config on the fly; so I have only 2 options:

  • mangle the original config file, with the risk of leaving a dirty situation on the user's config file;
  • create a copy of the config, with the right modifications.

Here comes another limitation: all paths in the config are relative. So I cannot rewrite the config somewhere else, like in /dev/shm as I would've likely done, without having to do further modifications to compensate for this issue.

Is there any other way to do this? Can I inject those extensions with a CLI parameter? Or this is a missing feature?

@sebastianbergmann

This comment has been minimized.

Copy link
Owner

@sebastianbergmann sebastianbergmann commented Mar 6, 2020

Extensions currently cannot be registered using a CLI option. I would consider a pull request that implements this.

@Jean85

This comment has been minimized.

Copy link
Contributor Author

@Jean85 Jean85 commented Mar 9, 2020

Thanks, I'll try to look into it! Is it possible that this feature would be backported to 8.x, so that we would have some overlap between the two approaches? (printer/hooks).

@sebastianbergmann

This comment has been minimized.

Copy link
Owner

@sebastianbergmann sebastianbergmann commented Mar 9, 2020

No new features for PHPUnit 8, sorry.

@Jean85

This comment has been minimized.

Copy link
Contributor Author

@Jean85 Jean85 commented Mar 11, 2020

633898a (coming from 9.0.1) broke this functionality. My bad for not including enough tests. PR with the fix incoming.

@Jean85

This comment has been minimized.

Copy link
Contributor Author

@Jean85 Jean85 commented Mar 11, 2020

Fix pushed in #4138.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.