akatie / fitnesse-launcher-maven-plugin

Automatically exported from code.google.com/p/fitnesse-launcher-maven-plugin
0 stars 1 forks source link

Fail the build when fitnesse server cannot start #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run fitnesse server on port 9123
2. Run a build with fitnesse-server-maven-plugin running fitnesse server on 
port 9123
3. Observe the build pass although fitnesse server cannot be started.

What is the expected output? What do you see instead?

Expected output should be for build to fail on every condition other than all 
fitnesse tests pass. So in this case if fitnesse server cannot be started the 
build should fail.

What version of the product are you using? On what operating system?

1.2.2 on Windows and Linux

Please provide any additional information below.

Excerpt from build log:
[13:51:29]:      [prm:prm-fitnesse-tests] Bind exception on port = 9123
[13:51:29]:      [prm:prm-fitnesse-tests] FitNesse cannot be started...
[13:51:29]:      [prm:prm-fitnesse-tests] Port 9123 is already in use.
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] 0 right, 0 wrong, 0 ignored, 0 
exceptions
[13:51:29]:      [prm:prm-fitnesse-tests] Use the -p <port#> command line argument 
to use a different port.
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] 
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] --- 
fitnesse-launcher-maven-plugin:1.2.2:tear-down (default) @ prm-fitnesse-tests 

---
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] 
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] --- 
maven-failsafe-plugin:2.12.3:verify (default) @ prm-fitnesse-tests ---
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] No tests to run.
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] 
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] --- 
fitnesse-launcher-maven-plugin:1.2.2:verify (default) @ prm-fitnesse-tests ---
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] 
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] --- 
maven-install-plugin:2.3.1:install (default-install) @ prm-fitnesse-tests ---
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] Installing 
D:\project\tcity\agentWork\apdtcityW8d_Windows\work\2b2173dbb4581847\prm-accepta
nce-tests\prm-fitnesse-tests\target\prm-fitnesse-tests-12.4.0-SNAPSHOT.jar to 
D:\project\tcity\agentWork\apdtcityW8d_Windows\.m2\repository\prm\prm-fitnesse-t
ests\12.4.0-SNAPSHOT\prm-fitnesse-tests-12.4.0-SNAPSHOT.jar
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] Installing 
D:\project\tcity\agentWork\apdtcityW8d_Windows\work\2b2173dbb4581847\prm-accepta
nce-tests\prm-fitnesse-tests\pom.xml to 
D:\project\tcity\agentWork\apdtcityW8d_Windows\.m2\repository\prm\prm-fitnesse-t
ests\12.4.0-SNAPSHOT\prm-fitnesse-tests-12.4.0-SNAPSHOT.pom
[13:51:29]:      [prm:prm-fitnesse-tests] [INFO] Installing 
D:\project\tcity\agentWork\apdtcityW8d_Windows\work\2b2173dbb4581847\prm-accepta
nce-tests\prm-fitnesse-tests\target\prm-fitnesse-tests-12.4.0-SNAPSHOT-sources.j
ar to 
D:\project\tcity\agentWork\apdtcityW8d_Windows\.m2\repository\prm\prm-fitnesse-t
ests\12.4.0-SNAPSHOT\prm-fitnesse-tests-12.4.0-SNAPSHOT-sources.jar
[13:51:30]:  [Step 2/2] [INFO] 
------------------------------------------------------------------------
[13:51:30]:  [Step 2/2] [INFO] Reactor Summary:
[13:51:30]:  [Step 2/2] [INFO] 
[13:51:30]:  [Step 2/2] [INFO] RM :: Acceptance Tests :: Database Tools 
.......... SUCCESS [10.886s]
[13:51:30]:  [Step 2/2] [INFO] RM :: Acceptance Tests :: Fitnesse Fixtures 
....... SUCCESS [12.667s]
[13:51:30]:  [Step 2/2] [INFO] RM :: Acceptance Tests :: Fitnesse Tests 
.......... SUCCESS [2:02.237s]
[13:51:30]:  [Step 2/2] [INFO] 
------------------------------------------------------------------------
[13:51:30]:  [Step 2/2] [INFO] BUILD SUCCESS
[13:51:30]:  [Step 2/2] [INFO] 
------------------------------------------------------------------------
[13:51:30]:  [Step 2/2] [INFO] Total time: 2:26.119s
[13:51:30]:  [Step 2/2] [INFO] Finished at: Mon Jul 08 13:51:30 CDT 2013
[13:51:30]:  [Step 2/2] [INFO] Final Memory: 53M/742M
[13:51:30]:  [Step 2/2] [INFO] 
------------------------------------------------------------------------
[13:51:30]:  [Step 2/2] Process exited with code 0

Original issue reported on code.google.com by krzyszto...@gmail.com on 9 Jul 2013 at 10:31

GoogleCodeExporter commented 8 years ago

Original comment by stewart@javahelp.co.uk on 9 Jul 2013 at 9:53

GoogleCodeExporter commented 8 years ago
FitNesse's response to the BindException which the ServerSocket throws, is to 
catch it and then print out the "FitNesse cannot be started..." message on 
System.err.

It returns a boolean back to fitnesseMain.FitNesseMain.launch(), which it acts 
on internall, but then launch() does not then return that to the external 
caller - it returns void instead.

I can currently think of 2 solutions, both reasonably involved:
- Do some stream redirection of System.err, so as to catch the log output,
- Or don't use fitnesseMain.FitNesseMain to launch FitNesse, but write an 
alternative. There may be some other issues which become easier to solve by 
virtue of doing this also.

Original comment by stewart@javahelp.co.uk on 16 Jul 2013 at 12:22

GoogleCodeExporter commented 8 years ago
Fix committed to /trunk at r402, using custom fitnesseMain.FitNesseMain class

Original comment by stewart@javahelp.co.uk on 1 Jul 2014 at 1:48