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

Use consistent php binary for running dusk tests #51

Merged
merged 4 commits into from
Jan 25, 2017
Merged

Use consistent php binary for running dusk tests #51

merged 4 commits into from
Jan 25, 2017

Conversation

splatEric
Copy link
Contributor

When trying to get dusk tests running on codeship, I ran into a problem where the php that was being triggered from the Process was call not consistent with the php binary I was using to run the command. This pull request tackles this by making using of the PHP_BINARY constant to use the same version of php.

I wrote this defensively as I wasn't sure if there might be circumstances under which the PHP_BINARY constant was not set.

@taylorotwell
Copy link
Member

It is always available. Just use it directly in the callback.

@@ -46,7 +46,7 @@ public function handle()
$options = implode(' ', array_slice($_SERVER['argv'], 2));

$this->withDuskEnvironment(function () use ($options) {
(new Process(trim('php vendor/bin/phpunit -c "'.base_path('phpunit.dusk.xml').'" '.$options), base_path(), []))
(new Process(trim(PHP_BINARY . ' vendor/bin/phpunit -c "'.base_path('phpunit.dusk.xml').'" '.$options), base_path(), []))
Copy link
Member

Choose a reason for hiding this comment

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

We never use spaces when concatenating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops, sorry!

@jkudish
Copy link

jkudish commented Jan 27, 2017

Thanks for this fix @splatEric, I was running into the same error with trying to get setup Codeship.

Sorry to hijack the thread, but I was wondering if you could share what steps you are taking to get dusk to run on Codeship now, if you have it working? Are you using artisan to serve the app? I am now getting these errors:

Curl error thrown for http POST to /session with params

@splatEric
Copy link
Contributor Author

splatEric commented Jan 27, 2017 via email

@jkudish
Copy link

jkudish commented Jan 27, 2017

Thanks a lot @splatEric that's super handy 👍

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.

3 participants