TS 72 PHP Continuous Integration

PHP Continuous Integration Test Specification for NetBeans 7.2

Author: Vladimir Riha
Version: 1.0
Last Update: 3rd April 2012

Sample project File:Php hudson sample project.zip

Installing Hudson/Jenkins & Sample project

  1. Open attached project in NetBeans
    • right click on project node in projects window
    • select Versioning | Initialize Mercurial project and initialize versioning
  2. Install Hudson (or Jenkins)
    • add plugin for Mercurial(Hg)
    • When you done register the server instance in NetBeans under Services|Hudson Builders
  3. Follow this setup process
    • notes:
      • it's possible not all plugins will be listed at http://localhost:8080/pluginManager/ so go to Advanced and at the bottom there is a Check Now button, press it to refresh plugin list
      • installing Hudson/Jenkins plugins from behind proxy causes trouble (Ubuntu 11.10) - if you can avoid proxy
      • for PHPDox you need this PHP extensions: ext/xsl,
        • on ubuntu, use command sudo apt-get install php5-xsl
      • make sure you have installed pear package phpunit/DbUnit
      • there seems to be error in PHPDox (at least with PHP 5.4), edit /usr/share/php/TheSeer/phpDox/shared/ErrorHandler.php and on the line 125 change it from
fwrite(STDERR, vsprintf('#%1$d %2$s(%3$d): %5$s%6$s%4$s()'."\n", $entry);

to

fwrite(STDERR, vsprintf('#%1$d %2$s(%3$d): %5$s%6$s%4$s()'."\n", print_r($entry, true)));


Contents


Test suite: New Job

  1. Create new job
    1. Select Team | Create build job from Main Menu
    2. Leave build name as it is
    3. Select the opened project in Project to Build
    4. No error should be shown (only warning information about sected path), press Create
    • EXPECTED RESULT: New job is added to Services
  1. Start Job

File:HudsonRunning.png

    1. Right click on Services|Hudson Builders|[your hudson]|sample_project
    2. Select start job
    • EXPECTED RESULT: Build started, there is a information about running job
  1. Job Status

File:HudsonPopup.png

    1. Right click on Services|Hudson Builders|[your hudson] and select Synchronize
    2. Statuses of all jobs are updated
    • EXPECTED RESULT: Sample_project build failed, there is a red circle icon in list of jobs, job name is in red and a small window popup window appears at the bottom of IDE with number indicating number of failed jobs
  1. Job Status detailed information
    1. Click on the tool icon and then on The Build failed text
    2. Statuses of all jobs are updated
    • EXPECTED RESULT: Ouput window with error message is displayed
  2. Setting Job Status notifications

File:HudsonConfirm.png

    1. Start the same job again
    2. Right click on Services|Hudson Builders|[your hudson] and select Synchronize
    3. Click on the tool icon and then on The Build failed text
    4. Confirmation dialog about Ignore Failures appears, confirm it
    5. Start the same job again
    • EXPECTED RESULT: No error popup window is displayed. Right click on the job and select Properties. Watch settings is unchecked. Check it again
  1. Setting Job Status notifications II
    1. Start the same job again
    2. Right click on Services|Hudson Builders|[your hudson] and select Synchronize
    • EXPECTED RESULT Popup window is displayed again
  2. Start succesful job

File:HudsonNodes.png

    1. Previously performed Team | Create build job creates some new files (build.xml etc)
    2. Commit all project changes by right click on project icon in Projects window, select Mercurial|Commit
    3. Add some message and commit changes
    4. Start the same job again
    5. Right click on Services|Hudson Builders|[your hudson] and select Synchronize
    6. Jobs succeded, icon is now blue
    7. Expand the job node in Services window
    • EXPECTED RESULT 2 items are there: "Remote workspace" (contains committed sources) and node named by number of build of the job (for each job one number named item)
  1. Show job details I
    1. Right click on the #[number] node and select Show console
    • EXPECTED RESULT Console with Hudson (ant) output is displayed
  2. Show job details II
    1. Right click on the #[number] node and select Show changes
    • EXPECTED RESULT Changes output window is displayed
  3. Show job details III
    1. Right click on the #[number] node and select Open in Browser
    • EXPECTED RESULT New page with Hudson job is opened in browser
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo