intellij-drupal-run-tests icon indicating copy to clipboard operation
intellij-drupal-run-tests copied to clipboard

Installing plugin in PHPStorm results in IDE error

Open kevinquillen opened this issue 9 years ago • 11 comments

Tried to add my first config, PHPStorm threw this error:

10:47:20 AM IllegalArgumentException: Argument for @NotNull parameter 's' of com/mglaman/drupal_run_tests/run/tests/DrupalRunConfiguration.setWorkingDirectory must not be null

kevinquillen avatar Jul 06 '16 14:07 kevinquillen

Ok... so it seems to depend on the Drupal integration path being configured. Next problem is, I am running Drupal within a VM, so the path should be /var/www/docroot as I am using the remote PHP interpreter in PHPStorm. Now I am getting this error:

Error running Migrate Drupal UI - Kernel: Invalid Drupal directory configured for this project.

No matter if I use the VM path, or the actual path on the host, I get the same message.

kevinquillen avatar Jul 06 '16 14:07 kevinquillen

Weird, I'll debug this. I work with using Docker and know people who have used the VM. However I have not tried with a remote interpreter in PHPStorm. Since it's checking the PHP interpeter in a few places I wonder if that's the problem.

mglaman avatar Jul 06 '16 22:07 mglaman

Yeah, I always tell PHPStorm about my Vagrant (in this case, DrupalVM), then tell it to use the remote PHP interpreter and map paths to /var/www/docroot. For example, when I set up Behat, PHPUnit or other integrations, the bin is using the path in the VM, where the interpreter lives.

Wonder if there is an easy workaround for this?

kevinquillen avatar Jul 07 '16 13:07 kevinquillen

Thanks for heads up you're using DrupalVM, means I can replicate that much easier.

Let me set that up and do some debugging. Not quite sure when, next week I'll be out of town working with AcroMedia on a Commerce 2.x sprint

mglaman avatar Jul 08 '16 12:07 mglaman

Just to chip in with my scenario:

  • drupal from the git repository
  • PHP interpreter running from AcquiaDevDesktop (so locally)

Same error: Argument for @NotNull parameter 's' of com/mglaman/drupal_run_tests/run/tests/DrupalRunConfiguration.setWorkingDirectory must not be null

gambry avatar Aug 17 '16 13:08 gambry

Okay, so this gets set via

        DrupalDataService drupalDataService = DrupalDataService.getInstance(getProject());
        setWorkingDirectory(drupalDataService.getDrupalPath());

I need to make sure that drupalDataService.getDrupalPath() is not null.

mglaman avatar Sep 11 '16 16:09 mglaman

@kevinquillen for PHPUnit, you're using the the Remote PHPUnit configuration, right? I think I'll need to make a "Remote" version for this as well, then.

mglaman avatar Sep 11 '16 16:09 mglaman

Don't know if this helps, but just tried creating a new instance using 'edit configrations...' and it failed to create a debug configuration pane with a null pointer exception. Following the hint in this issue, I added the drupal site path to the phpstorm project and re-tried adding a new debug configuration, and it worked -- in the sense that I now get debug configuration pane.

Could the code check for the drupal path being set and offer a 'Fix' for it if not?

rivimey avatar Dec 10 '16 15:12 rivimey

:/ it used to prompt for the fix button. This is a regression

On Sat, Dec 10, 2016, 9:21 AM Ruth Ivimey-Cook [email protected] wrote:

Don't know if this helps, but just tried creating a new instance using 'edit configrations...' and it failed to create a debug configuration pane with a null pointer exception. Following the hint in this issue, I added the drupal site path to the phpstorm project and re-tried adding a new debug configuration, and it worked -- in the sense that I now get debug configuration pane.

Could the code check for the drupal path being set and offer a 'Fix' for it if not?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mglaman/intellij-drupal-run-tests/issues/17#issuecomment-266215491, or mute the thread https://github.com/notifications/unsubscribe-auth/ADhv1Bcv7MEQ4zj58MbfbDt58YY0tDNjks5rGsN1gaJpZM4JGKMy .

mglaman avatar Dec 10 '16 15:12 mglaman

Sorry, didn't say... running 2016.2 (ie not latest build). Drupal configured in a VM using Virtualbox.

rivimey avatar Dec 10 '16 15:12 rivimey

Yeah, I haven't tested using a remote interpreter at all. I need to setup a Vangrant box and test with it (I use Docker, with local php executable)

On Sat, Dec 10, 2016, 9:26 AM Ruth Ivimey-Cook [email protected] wrote:

Sorry, didn't say... running 2016.2 (ie not latest build). Drupal configured in a VM using Virtualbox.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mglaman/intellij-drupal-run-tests/issues/17#issuecomment-266215854, or mute the thread https://github.com/notifications/unsubscribe-auth/ADhv1KuCL2ewcpSHvWamTcQ1CPEbf5q_ks5rGsSggaJpZM4JGKMy .

mglaman avatar Dec 10 '16 15:12 mglaman