Zend Debugger client's IP detection problem / Remote phpUnit testing

It seems, there is a problem with client's IP address(es) detection by PhpStorm (debug_host param).
I have several Etherenet interfaces on my Win7 machine (LAN, VirtualBox adapter, VPN). When trying to auto-configurate Zend Debug Toolbar for FireFix it works, but phpStorm sends incorrect IP. Technically it's not incorrect, it's just first IP phpStorm has found. However, I haven't found a way to adjust/override it somewhere in PhpStorm settings. For the FireFox toolbar, I can simply enter correct IP in the manual settings of the toolbar, but the same incorrect IP is sent to remote phpUnit runner, when trying to debug a unit test on a remote server. I was unable to find a workaround for that.

Here is how it looks like:

> ipconfig output:

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : some.com
   Link-local IPv6 Address . . . . . : fe80::69f0:133f:6c9d:d09f%10
   IPv4 Address. . . . . . . . . . . : 1.2.3.4 <- My actual IP
   Subnet Mask . . . . . . . . . . . : 255.255.255.128
   Default Gateway . . . . . . . . . : 1.2.3.1

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::7da6:98ef:8a5d:f380%19
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Default Gateway . . . . . . . . . :


Apache's log of PhpStorm request trying to run the phpUnit runner in debug mode:

1.2.3.4 - - [01/Sep/2011:22:33:23 +0300] "GET /project/tests/Some/_intellij_phpunit_launcher.php?send_sess_end=1&start_debug=1&debug_port=10137&file=SomeTest.php&debug_session_id=16141&debug_host=192.168.56.1%2C127.0.0.1&debug_start_session=1&mode=f HTTP/1.1" 200 81 "-"

PhpStorm's test console output:

Testing started at 10:33 PM ...
Uploading test files to Server...
Executing tests
Failed to connect to host '192.168.56.1'. Failed to connect to host '127.0.0.1'.
Cleaning up...



Does someone know if it's possible to adjust somewhere or should I file a ticket to fix that?

Some more things noticed when trying to setup phpUnit on remote server:

- "Use XML configuration file" setting inside Run Configurations -> Defaults -> PHPUnit on Server is NOT automatically copied to newly created run configurations (when I right-click a folder or file with tests). This results in tests bootstrapping incorrectly and not working. When, I manually adjust this setting for automatically created Run configuration - it works.
- There is no option to disable automatic upload of test files to the server. I have a project configured for automatic deployment to the server through a mapped drive with "Upload changes on save turned on", so reuploading several hundreds of test files makes no sense at all and just takes time. Is there a way to disable it?
- I was unable to figure out how to configure remote unit testing to run tests from a different base directory, corresponding to selected directory. Normally the tests are located in different directory, mirroring the structure of the actual classes you are testing, such as:

lib/Some/Other/Class.php
tests/Some/Other/ClassTest.php


So, while working in Class.php you need to run a corresonding test. Is there a way to configure PhpStorm to run tests accordingly? Probably some variable magic in paths (like the one used in External Tools) may help... Another option would be adjust _intellij_phpunit_launcher.php. What do you suggest?

Thanks!

P.S. All of the above was tested/noticed in PhpStorm 2.3.1 PS-107.581 running on Win7 64bit

3 comments
Comment actions Permalink

Hello Konstantin,

Sorry for delay.

When trying to auto-configurate Zend Debug Toolbar for FireFix it works, but phpStorm sends incorrect IP.

We recommend to try our Zend Debugger bookmarklets generator - http://www.jetbrains.com/phpstorm/marklets/

Does someone know if it's possible to adjust somewhere or should I file a ticket to fix that?

There is no way to configure this option from PhpStorm. Please submit an issue - http://youtrack.jetbrains.net/issues/WI#newissue=yes


Thanks for the feedback!

0
Comment actions Permalink

Konstantin,

- "Use XML configuration file" setting inside Run Configurations -> Defaults -> PHPUnit on Server is NOT automatically copied to newly created run configurations (when I right-click a folder or file with tests). This results in tests bootstrapping incorrectly and not working. When, I manually adjust this setting for automatically created Run configuration - it works.

It is a bug. Please submit an issue - http://youtrack.jetbrains.net/issues/WI#newissue=yes

- There is no option to disable automatic upload of test files to the server. I have a project configured for automatic deployment to the server through a mapped drive with "Upload changes on save turned on", so reuploading several hundreds of test files makes no sense at all and just takes time. Is there a way to disable it?

No, it is not implemented yet. Please submit an issue - http://youtrack.jetbrains.net/issues/WI#newissue=yes

- I was unable to figure out how to configure remote unit testing to run tests from a different base directory, corresponding to selected directory. Normally the tests are located in different directory, mirroring the structure of the actual classes you are testing, such as:

lib/Some/Other/Class.php
tests/Some/Other/ClassTest.php

Please submit an issue - http://youtrack.jetbrains.net/issues/WI#newissue=yes


Thanks you for awesome feedback!

0
Comment actions Permalink

Hi Nikolay,

Thanks for your response. I have submitted several issues based on this discussion. Here they are:

http://youtrack.jetbrains.net/issue/WI-7465?projectKey=WI
http://youtrack.jetbrains.net/issue/WI-7466?projectKey=WI
http://youtrack.jetbrains.net/issue/WI-7467?projectKey=WI
http://youtrack.jetbrains.net/issue/WI-7468?projectKey=WI

Everybody reading this thread, please vote on these issues :) Really hope to see them resolved soon. Thanks!

0

Please sign in to leave a comment.