Sunday, December 6. 2009phpUnderControl 0.5.0 releasedTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Great, I had heard about PHP_CodeBrowser for phpuc, but didn't understand how to set it up in the old version.
As for the ant vs cruisecontrol build, you could potentially put the phpcb command in a seperate ant task to be executed. That way you would be able to keep the config.xml standard per project, and giving the project the ability to define the source locations.
I've managed to update my build process to use antpublisher rather than an execute, you can simply replace the execute with
<antpublisher buildfile="projects/${project.name}/build.xml" target="publish" /> and add ant publish targets to run the code browser compiler
Hello Andy,
I am really interested in your solution when it also handles the described problem with the @failonerror="on" attribute. Greetings Manuel
I'm not sure what you mean in that last comment. Do you mean it doesn't handle the failonerror problem?
I haven't tested it myself on a failing build, but according to the documentation, it says it will run whether the build fails or not, and also it provides ant properties to be usable by the ant target. http://cruisecontrol.sourceforge.net/main/configxml.html#antpublisher What I'm suggesting is running a separate ant target that doesn't depend on the phpunit target.
Hello Andy,
what I mean is. You need to generate the CodeBrowser when all other targets in your build file are finished. This means you will have something like: 1) build (depends: update,codesniffer,phpunit,codebrowser) 2) update 3) codesniffer 4) phpunit 5) codebrowser When now the 4) phpunit target fails, ant and imho also phing, will never execute the last target 5) codebrowser and so you will not get an actual codebrowser. Greetings Manuel
ah right, but as I said, the codebrowser could be another ant target that gets executed separately by another ant run.
i.e build depends: update,codesniffer,phpunit publish depends: codebrowser antpublisher will run (as far as I can tell), a separate ant execute command whether or not it fails the ant build. I'm not entirely convinced of putting it in the ant file however, as its purely for phpuc, and not a distributable artifact or failure check like the others. The main thing for me at least, is the source directory, which if differs between projects, I'd rather have it in the ant script, which is in the project's svn repo.
That is antpublisher being put in the <publishers> tag, so it will run this after the build, during the publishing phase.
nice!
take care: the link to the zip file for download is broken (missing 's')
Hi,
thanks for that hint. I have fixed the download link on the php-under-control.org website. Greetings Manuel
I'm getting a fatal error on phpunit pear package install:
Notice: Undefined index: name in PEAR/Downloader/Package.php on line 621 PHP Notice: Undefined index: name in /usr/share/pear/PEAR/Downloader/Package.php on line 621 PHP Stack trace: PHP 1. {main}() /usr/share/pear/pearcmd.php:0 PHP 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 PHP 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 PHP 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 PHP 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 PHP 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 PHP 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 Notice: Undefined index: name in /usr/share/pear/PEAR/Downloader/Package.php on line 621 Call Stack: 0.0022 337784 1. {main}() /usr/share/pear/pearcmd.php:0 0.1282 4359024 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 0.1282 4359024 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 0.1691 7698368 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 2.4660 10178712 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 2.4661 10178712 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 2.4661 10178712 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 Notice: Undefined index: info in PEAR/Downloader/Package.php on line 1113 PHP Notice: Undefined index: info in /usr/share/pear/PEAR/Downloader/Package.php on line 1113 PHP Stack trace: PHP 1. {main}() /usr/share/pear/pearcmd.php:0 PHP 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 PHP 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 PHP 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 PHP 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 PHP 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 PHP 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 PHP 8. PEAR_Downloader_Package->willDownload() /usr/share/pear/PEAR/Downloader/Package.php:622 PHP 9. PEAR_Downloader_Package->isEqual() /usr/share/pear/PEAR/Downloader/Package.php:1486 Notice: Undefined index: info in /usr/share/pear/PEAR/Downloader/Package.php on line 1113 Call Stack: 0.0022 337784 1. {main}() /usr/share/pear/pearcmd.php:0 0.1282 4359024 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 0.1282 4359024 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 0.1691 7698368 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 2.4660 10178712 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 2.4661 10178712 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 2.4661 10178712 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 2.4664 10179048 8. PEAR_Downloader_Package->willDownload() /usr/share/pear/PEAR/Downloader/Package.php:622 2.4664 10179048 9. PEAR_Downloader_Package->isEqual() /usr/share/pear/PEAR/Downloader/Package.php:1486 PHP Fatal error: Call to a member function getPackage() on a non-object in /usr/share/pear/PEAR/Downloader/Package.php on line 1113 PHP Stack trace: PHP 1. {main}() /usr/share/pear/pearcmd.php:0 PHP 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 PHP 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 PHP 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 PHP 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 PHP 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 PHP 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 PHP 8. PEAR_Downloader_Package->willDownload() /usr/share/pear/PEAR/Downloader/Package.php:622 PHP 9. PEAR_Downloader_Package->isEqual() /usr/share/pear/PEAR/Downloader/Package.php:1486 Fatal error: Call to a member function getPackage() on a non-object in /usr/share/pear/PEAR/Downloader/Package.php on line 1113 Call Stack: 0.0022 337784 1. {main}() /usr/share/pear/pearcmd.php:0 0.1282 4359024 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305 0.1282 4359024 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271 0.1691 7698368 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661 2.4660 10178712 5. PEAR_Downloader_Package->detectDependencies() /usr/share/pear/PEAR/Downloader.php:391 2.4661 10178712 6. PEAR_Downloader_Package->_detect2() /usr/share/pear/PEAR/Downloader/Package.php:381 2.4661 10178712 7. PEAR_Downloader_Package->_detect2Dep() /usr/share/pear/PEAR/Downloader/Package.php:502 2.4664 10179048 8. PEAR_Downloader_Package->willDownload() /usr/share/pear/PEAR/Downloader/Package.php:622 2.4664 10179048 9. PEAR_Downloader_Package->isEqual() /usr/share/pear/PEAR/Downloader/Package.php:1486 I installed phpUC and phpUnit last week and that went smoothly, but trying to update phpUC today failed. I can install from the pear channel, but not phpunit. Any ideas?
Hi,
sorry no clue what's going wrong here, but it seems to be a pear issue, so please file at ticket in the pear issue tracker. Greetings Manuel
Hi there,
I tried to upgrade from phpuc 0.4.7 to phpuc 0.5.0 but I've got an issue : No graphs are displayed in "Metrics" tab (whereas they were displayed using 0.4.7). Here are the commands I executed: - sudo pear channel-update pear.phpunit.de - sudo pear upgrade --alldeps phpunit/phpUnderControl - sudo phpuc install /opt/cruisecontrol And I've updated "config.xml" as explained in release notes. Tell me if I'm wrong but the graphs are generated from this line : <execute command="phpuc graph logs/${project.name} artifacts/${project.name}"/> I tried to execute this line from command line and here is the message I got: The value '1' that you were trying to assign to setting 'labelCount' is invalid. Allowed values are: int > 1. If someone could shed my light, that would be perfect. Many thanks
Hi,
sorry, in some cases there seems to be an issue with *phpUnderControl/Graph/Input/ClassComplexityInput.php*. As a workaround you should drop that file, because for the moment it is not used. Greetings Manuel
I ran into the same issue, I found this solution which works for me:
http://www.phpunit.de/ticket/931
It is the default firefox theme shipped with Ubuntu 9.10 and the Gnome theme Darklooks
I have set up phpUnderControl with the exception of the phpunit target. All my test cases are written for the Zend Framework.
Here is a sample test case: <?php require_once dirname(_FILE_) . '/../../../TestConfiguration.php'; class IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function setup() { $bootstrap = TestConfiguration::$bootstrap; $this->bootstrap = array($bootstrap, 'configureFrontController'); parent::setUp(); } public function testHomePageIsASuccessfulRequest() { $this->dispatch('/'); $this->assertFalse($this->response->isException()); $this->assertNotRedirect(); } public function testHomePageDisplaysCorrectContent() { $this->dispatch('/'); $this->assertQueryContentContains('h1', 'Welcome'); $this->assertQueryContentContains('h2', 'Users'); $this->assertQueryContentContains('td a', 3); $this->assertQueryContentContains('td a', 'Mike'); } } Unfortunately the extended class is causing problems, because it can't find Zend_Test_PHPUnit_ControllerTestCase, resulting in phpUnit spitting out the following error: Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/TestCase.php' (include_path=':/opt/cruisecontrol-bin-2.8.2/projects/brass/source/library/:/opt/cruisecontrol-bin-2.8.2/projects/brass/source/application/default/models/:/opt/cruisecontrol-bin-2.8.2/projects/brass/source/application/default/services/') in /opt/cruisecontrol-bin-2.8.2/projects/brass/source/library/Zend/Test/PHPUnit/ControllerTestCase.php on line 4 Is there a way to have phpUnderControl play nice with ZF test cases? Thanks! - Mike
Hi Manuel,
I just installed the new release with a "PEAR ua". It suprised me although I was happy to see the evolvment. I did not read your blog till now, although I'm monitoring phpundercontrol.org. As I see the roadmap there was not updated that's why the new release was suprising me. Anyway, for lamers as me, would you state somewhere to shot down cruisecontroll process before starting "phpuc install <ccpath>" as it screws up the runing build a bit (I know I run into it). Thanx for the tool and keep it up, it is a great help for the Open Source Community...!
Hi Manuel,
Thanks for creating this; it's an invaluable tool for us. I had a small request ... in the code sniffer reports section, as it currently stands, the detail section does not show file names - for code with a lot of sniffer errors, this can get a bit confusing. I tweaked mine to show those. In phpcs-details.xsl line 89 I added <code><xsl:value-of select="$javaclass"/></code> to this code to show that. <code> <h select="$javaclass"/>*<xsl:value-of select="$javaclass"/>* (<xsl:value-of select="count(error[@severity='error'])"/> / <xsl:value-of select="count(error)"/>) </code> (Hope this appears as code) Just wondering whether it could make it into future releases. Cheers, Paul
I have the same experience.
Also it looks like this only happens if you create the output with "--output-file" instead fo capturing the whole output with Ant. In the later case you will not see any result as the PHP Notices that phpcs currently produces will mess up xml. I submitted a bugreport about this both for phpcs and phpundercontrol.
Hi Manuel,
thanks for this great tool. I'm experiencing difficulties with the new release 2.8.3 of CruiseControl. The "currentbuildstatuspublisher" seems to be deprecated and support was removed within this release. Do you know a workaround for this? All the best, Bastian
CurrentBuildStatusPublisher was removed and now CurrentBuildStatusListener is used instead. You can see this in the top of your CruiseControl's config.xml file.
You can safely remove the CurrentBuildStatusPublisher from this file and you must change the filename of the CurrentBuildStatusListener to buildstatus.txt instead of status.txt. I hope this helps!
Addendum: I appear to have been incorrect about changing the filename to buildstatus.txt, it should remain status.txt.
Thus all you have to do is remove the publisher and it works perfectly!
Hey Mike,
thank you for that hint. Have fixed this 2.8.3 related issue in the latest phpUnderControl version on github. But I must admit, I haven't noticed that the status publisher was already deprecated :/ Greetings Manuel
Where should I file this bug of PHP_CodeBrowser-0.1.1 :
When phpunit finds lots of bad stuff it issues a violation tag in the phpunit.pmd.xml log for the entire project. That means this violation element is not a sub element of a file tag (like common violation tags are). This breaks phpcb, because it expects a file tag with a name attribute and the violation tag it actually gets has no name attribute. phpcb issues a wrong error message saying "The source defined by parameter --source, differs to the source extracted from log files!", totally startling the poor user. |
ProjectsFurther stuffCategories |

