1 Reply Latest reply on Nov 25, 2011 3:07 AM by Simon Bailey

    FlexUnit not generating TestRunner.swf when compiled with Hudson / Ant

    fixxxer_uk

      I've been dabbling with FlexUnit (4.1 RC2) and CI under Hudson. To that effect, I chose to test the server configuration with the sample CI project that comes with the 4.1 RC2 distribution of FlexUnit, and compiling the project with Hudson (now Jenkins after most recent update) and Ant (1.8). It doesn't work because it does not seem to compile the TestRunner swf. After exploring the artifacts in the workspace, it appears that the TestRunner mxml file is created as you would expect, but then the mxmlc compiler is seemingly silently failing to complete the compile step.

       

      It's worth noting at this point that compiling on my local dev machine does work (as it does on a half dozen other dev machines), also, the Hudson configuration is good for compiling other Flash projects. So mxmlc from the Flex SDK is setup and compiling other projects successfully.

       

      Here's the first part of the build log from Hudson / Jenkins as it tries to compile the sample project:

      compile:
          [mxmlc] Loading configuration file /opt/flex/frameworks/flex-config.xml
      
      test:
       [flexunit] Validating task attributes ...
       [flexunit] Generating default values ...
       [flexunit] Using the following settings for compilation:
       [flexunit]      FLEX_HOME: [/opt/flex]
       [flexunit]      player: [flash]
       [flexunit]      sourceDirectories: ["/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/src/main/flex"]
       [flexunit]      testSourceDirectories: ["/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/src/test/flex"]
       [flexunit]      libraries: ["/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-4.1.0_RC2-4-as3_4.1.0.16076.swc","/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-aircilistener-4.1.0_RC2-4-4.1.0.16076.swc","/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-cilistener-4.1.0_RC2-4-4.1.0.16076.swc","/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-uilistener-4.1.0_RC2-4-4.1.0.16076.swc"]
      
       [flexunit] Found SDK version: 4
       [flexunit] Created test runner at [/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin/TestRunner.mxml]
       [flexunit] Compiling test classes: [org.flexunit.demo.EchoPanelTest, org.flexunit.demo.SampleTest]
       [flexunit] Executing '/var/lib/jenkins/tools/JDK_6/jre/bin/java' with arguments:
       [flexunit] '-Xmx256M'
       [flexunit] '-jar'
       [flexunit] '/opt/flex/lib/mxmlc.jar'
       [flexunit] '+flexlib'
       [flexunit] '/opt/flex/frameworks'
       [flexunit] '-output'
       [flexunit] '/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin/TestRunner.swf'
       [flexunit] '-source-path'
       [flexunit] '/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/src/main/flex'
       [flexunit] '/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/src/test/flex'
       [flexunit] '-library-path+=/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-4.1.0_RC2-4-as3_4.1.0.16076.swc'
       [flexunit] '-library-path+=/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-aircilistener-4.1.0_RC2-4-4.1.0.16076.swc'
       [flexunit] '-library-path+=/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-cilistener-4.1.0_RC2-4-4.1.0.16076.swc'
       [flexunit] '-library-path+=/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/libs/flexunit-uilistener-4.1.0_RC2-4-4.1.0.16076.swc'
       [flexunit] '-headless-server=true'
       [flexunit] '/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin/TestRunner.mxml'
       [flexunit] 
       [flexunit] The ' characters around the executable and arguments are
       [flexunit] not part of the command.
       [flexunit] 
           [null] Loading configuration file /opt/flex/frameworks/flex-config.xml
      
      

      After this line I would expect another line indicating the swf output and the size of the file - as I see in the build log on my dev machine - but that never happens because mxmlc never writes the swf. I have no idea why this fails.

       

      Then there is a bunch of other stuff to do with attempting to launch the test with Xvnc:

       [flexunit] Using the following settings for the test run:
       [flexunit]      FLEX_HOME: [/opt/flex]
       [flexunit]      haltonfailure: [false]
       [flexunit]      headless: [false]
       [flexunit]      display: [99]
       [flexunit]      localTrusted: [true]
       [flexunit]      player: [flash]
       [flexunit]      port: [1024]
       [flexunit]      swf: [/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin/TestRunner.swf]
       [flexunit]      timeout: [60000ms]
       [flexunit]      toDir: [/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/report]
       [flexunit] Setting up server process ...
       [flexunit] Starting server ...
       [flexunit] Opening server socket on port [1024].
       [flexunit] Waiting for client connection ...
       [flexunit] Entry [/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin] already available in local trust file at [/var/lib/jenkins/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg].
       [flexunit] Executing 'gflashplayer' with arguments:
       [flexunit] '/var/lib/jenkins/jobs/FlexUnit4SampleCIProject/workspace/FlexUnit4SampleCIProject/target/bin/TestRunner.swf'
       [flexunit] 
       [flexunit] The ' characters around the executable and arguments are
       [flexunit] not part of the command.
       [flexunit] 
       [flexunit] 
       [flexunit] Error: Invalid SWF file name
       [flexunit] 
      
       [flexunit] 
       [flexunit] Stopping server ...
       [flexunit] End of test data reached, sending acknowledgement to player ...
       [flexunit] Closing client connection ...
       [flexunit] Closing server on port [1024] ...
      
      

      But of course by this point we're toast because mxmlc has not output the TestRunner swf, so the filename is invalid. If anyone has any idea what's wrong, or any suggestions on things to try, please let me know, we're desperate!!

       

      Thanks for your time.