I'm trying to enable remote-debugging with fitnesse. Getting below error.
Could not complete testing: java.lang.Exception: FitClient: external
process terminated before a connection could be established.
To start fitnesse in debug-mode, i'm adding below startup command
set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9000
java -jar %DEBUG_OPTS% fitnesse-standalone.jar -p 81
And with this, able to connect to the Fitness process, but enabling Tools->Remote Debug from Fitnesse GUI gives above error. Any pointers?
FitNesse is starting the System under test in a separate process by default. You can execute the test suite with debugging enabled, e.g. "MySuite?suite&debug".
Make sure all required libraries are on your class path (the one you use to start FitNesse "java -cp jar1.jar:classes:fitnesse-standalone.jar fitnesseMain.FitNesseMain -p 81"), since your application will be started inside the FitNesse process.
Related
I'm trying to use Xdebug (v3) through PhpStorm (v2022.3.2) to debug a PHPUnit test method from inside a Docker container.
Xdebug is correctly setup and also the server in PhpStorm is.
In fact, if I run tests from command line, Xdebug stops at breakpoints:
XDEBUG_SESSION=1 PHP_IDE_CONFIG="serverName=myapp.localhost" vendor/bin/phpunit --testdox --filter testProfileUpdate
If I debug the test clicking on the "bug" icon on the left of the test method, instead, I receive the following error:
Connection was not established. Probably 'xdebug.remote_host=host.docker.internal' is incorrect. Change 'xdebug.remote_host'.
Looking at the command executed by PhpStorm to debug a test method, here is what I see:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Tried to configure two more flags
I've also tried to configure two more flags:
-dxdebug.idekey="serverName=myapp.localhost"
-dxdebug.session=1
The resulting command is this:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal -dxdebug.idekey="serverName=myapp.localhost" -dxdebug.session=1 /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Also with this configuration, Xdebug doesn't start and breakpoints are ignored (and the error message pops up).
Tried to disable params passed by PhpStorm
I tried to disable params passed automatically by PhpStorm going to Settings > PHP > Debug.
Then, in the section "Advanced settings" I unflagged the option "Pass required configuration options through command line".
Now, the resulting command is this:
[docker://myapp:latest/]:php /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
As you can see, there is no mention of xdebug.client_host nor of xdebug.remote_host.
Nevertheless, PhpStorm continues to pop up the same error mentioning xdebug.remote_host=host.docker.internal.
I imagined that an error should have occurred, but different, something saying a required parameter is missed.
Request for help
Any idea about how to configure PhpStorm to start an Xdebug session to debug a PHPUnit test?
-dxdebug.client_port=9000
Xdebug 3 now uses 9003 port by default instead of 9000. Try sticking to this.
In PhpStorm you most likely have both ports listed (9000,9003 as a default value, to cover new and old Xdebug versions) and it uses the first one for CLI scripts (which PHPUnit is). Either remove it (preferred; so you will only have 9003 there) or make it last (i.e. 9003,9000).
-dxdebug.idekey="serverName=myapp.localhost"
This will not work (wrong approach). You are trying to pass it as Xdebug IDEKey param... but it actually should be the value of the ENV variable named PHP_IDE_CONFIG.
If you want to actually use it:
Look into the PHPUnit config file: it has the ability to set up custom ENV variables for tests.
Another place: PhpStorm's Run/Debug Configuration for PHPUnit has an Environment variables field: try using it for this purpose.
Or use it in your actual docker file/config.
Other than that: enable Xdebug log (xdebug.log), try to debug (both when it's working and when it's not) and see what the log has to say for both runs (where it connects to, what the response is etc). You should spot the difference that should give the clues on what might be wrong (in which direction to dig further).
This actually should be the first step when investigating "why it works here and not there" situations.
I'm following JMeter wiki page of CommittingChanges which was updated.
I'm running
ant checkstyle
ant package
ant test
Test Failed with error in differences from Bug52310.csv:
BUILD FAILED
C:\jmeter\jmeter\build.xml:2681: The following error occurred while executing th
is line:
C:\jmeter\jmeter\build.xml:2621: CSV Files are not identical.
C:\jmeter\jmeter\bin\testfiles\Bug52310.csv
ComputeIPAddr,200,OK,TG2 1-1,text,true
HTTP-Request-HC31,200,OK,TG2 1-1,text,true
HTTP-Request-HC4,200,OK,TG2 1-1,text,true
C:\jmeter\jmeter\bin\Bug52310.csv
ComputeIPAddr,200,OK,TG2 1-1,text,true
HTTP-Request-HC31,Non HTTP response code: java.net.SocketException,Non HTTP resp
onse message: Network is unreachable: connect,TG2 1-1,text,false
HTTP-Request-HC4,Non HTTP response code: java.net.SocketException,Non HTTP respo
nse message: Network is unreachable: connect,TG2 1-1,text,false
Total time: 3 minutes 9 seconds
Is it a bug or configuration/network issue? can all JMeter tests be execute in local environment?
EDIT
Also next step is to run different test
ant test-headless or ant test-headed (whichever was not run by the ant test)
Why not execute ant test-both in the first place?
when I execute ant test-headed and even and test-both it worked successfully
Regarding your first issue, it looks like a temporary connectivity issue from your machine or more probably that test computes an IP address for your machine that is not reachable .
This test exists to test ip-spoofing feature by setting the ip source to your machine address.
Run it in gui and see what IP is computed on your machine then try to resolve it.
Regarding ant test-both, yes it would be better, report a bug please.
In approximately 1 of 10 of our fitnesse test runs running headless (from cmd line, not in browser) the run hangs in fitnesse.testrunner.MultipleTestsRunner.waitForTestSystemToSendResults
We ensured with using listeners and console output that all tests that were announced to run are completed. We used the following methods to ensure that:
fitnesse.testrunner.TestsRunnerListener.announceNumberTestsToRun(int) and fitnesse.testsystems.TestSystemListener.testComplete(PageType, TestSummary)
So our tests always hang after the last test of the suite was executed. The wait is done until a volatile member int testsInProgressCount is decreased to 0 but this does not seem to happen.
Does anybody have similar issues with fitnesse or any idea what is the reason or a good idea how to troubleshoot the issue?
Some more information:
Fitnesse version: 20150814
Platform: Linux centos 6.5 (kernel is 2.6.32-431.el6.x86_64)
Cmdline (simplified): java -cp <CLASSPATH> -r fitnesse -c <TestSuiteName>?suite&format=xml&includehtmlFalse -b OutFile -p <PORT> fitnesseMain.FitNesseMain
using 1.8
Hi I am running my functional tests using geb.
I am able to run tests on my local computer correctly. but as I deploy my application to server. the build for functional tests fails.
Here is my console output
|Running 10 spock tests... 1 of 10
Failure: |
sign in with voucher
|
geb.driver.DriverCreationException: failed to create driver from callback 'script14007213321291157436758$_run_closure1#77068fce'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:346)
at geb.Configuration.getDriver(Configuration.groovy:335)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.go(Browser.groovy:377)
at geb.Page.to(Page.groovy:171)
at geb.Browser.via(Browser.groovy:454)
at geb.Browser.to(Browser.groovy:413)
at geb.Browser.to(Browser.groovy:391)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at VoucherSpec.sign in with voucher(VoucherSpec.groovy:14)
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/local/bin/firefox) on port 7056; process output follows:
Error: no display specified
Error: no display specified
Can anyone guide me to solve this issue.
The server you're running the tests on is 'headless' so doesn't have a display to start Firefox on to run the tests. You've got a couple of options:
Switch from Firefox to a headless browser such as HTMLUnit.
Configure a virtual display on the server.
Use a remote browser service such as SauceLabs.
If you need to test directly on Firefox then HTMLUnit isn't an option for you.
Using a remote browser service such as SauceLabs or BrowserStack has a couple of advantages, for example they record a video of the session and take screenshots, but we found the overhead of passing commands & traffic over the network made the tests unacceptably slow. If you need to test a wide variety of browsers then the overhead diminishes because you can run in parallel...
Option 2, using a virtual display, is the simplest to configure on most servers. If you're using Linux the X Virtual Frame Buffer (XVFB) will get you up and running quickly. It's worth reading up on what's going on but the short answer is:
Install XVFB (sudo apt-get install xvfb)
Install Firefox (sudo apt-get install firefox)
Start XVFB (sudo Xvfb :10 -ac -screen 0 1024x768x8 &). You may want to add an init script so this happens every time the server starts
In your CI server add export DISPLAY=:10 as a step before the tests are run
Run your tests
The XVFB creates a virtual display on :10, which you then set as the default display. When you start Firefox it's completely unaware that it's on a virtual display, so things like getting Geb to take screenshots of failing tests will work as normal.
For more information about the steps see:
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
https://github.com/tomaslin/grails-test-recipes
http://www.semicomplete.com/blog/geekery/xvfb-firefox.html
http://www.labelmedia.co.uk/blog/setting-up-selenium-server-on-a-headless-jenkins-ci-build-machine.html
http://manpages.ubuntu.com/manpages/lucid/man1/xvfb-run.1.html
If you need an init script to get it to start/stop, then there are quite a few to choose from, such as this one.
When running the Fitnesse tests via command Line I am getting a ClassNotFound Exception
caused by Java.lang.ClassNotFoundException:fitnesse.runner.testRunner
could not find the main class:fitnesse.runner.TestRunner.Program will exit
Kindly help
Thanks
TestRunner is no longer supported. Use http://fitnesse.org/FitNesse.UserGuide.CommandLineRestCommands
Update: link has changed - http://www.fitnesse.org/FitNesse.UserGuide.ControllingFitNesseFromTheCommandLine
Update: link has changed again - http://fitnesse.org/FitNesse.UserGuide.AdministeringFitNesse.ControllingFitNesseFromTheCommandLine
Excerpt from Fitnesse docs:
You can run any REST command (See Restful Services) from the command
line by using the -c command line option as follows:
java -jar fitnesse-standalone.jar -c
This starts up fitnesse, runs the command, emits the output to
standard out, and then exits.
Most often you will use this to run tests and/or suites from the
command line as follows:
java -jar fitnesse-standalone.jar -c "MyTestPage?test&format=text"