stable

Clone or download

Read-only

Move the retrieval of the remote data of a Jenkins job in a dedicated class

This contribution is purely technical, it is only an (ugly) refactoring. The goal is to move outside the HudsonJob class the retrieval of the XML content so that in the future it is possible to instanciate the jobs even if takes too long. It could also be used to retrieve the XML content of multiple jobs in parallel. Since the existing tests for the HudsonJob class had a lot of changes, the oppurtunity has been took to move these tests to PHPUnit. This is part of request #11415: Displaying all CI jobs can be slow Change-Id: I12d7c32167ff6d1f31f584a0ecd08ae382c819e3

Modified Files

Name
M plugins/hudson/include/HudsonJob.class.php +46 −93 Go to diff View file
A plugins/hudson/include/HudsonJobBuilder.php +77 −0 Go to diff View file
M plugins/hudson/include/HudsonJobWidget.class.php +0 −2 Go to diff View file
M plugins/hudson/include/HudsonWidget.class.php +7 −30 Go to diff View file
A plugins/hudson/include/MinimalHudsonJob.php +55 −0 Go to diff View file
R plugins/hudson/include/HudsonJobFactory.class.php Go to diff View file
M plugins/hudson/include/autoload.php +6 −4 Go to diff View file
M plugins/hudson/include/hudsonActions.class.php +11 −4 Go to diff View file
M plugins/hudson/include/hudsonPlugin.class.php +28 −20 Go to diff View file
M plugins/hudson/include/hudsonViews.class.php +10 −5 Go to diff View file
M plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php +16 −12 Go to diff View file
M plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php +16 −7 Go to diff View file
M plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php +14 −5 Go to diff View file
M plugins/hudson/include/hudson_Widget_JobTestResults.class.php +15 −13 Go to diff View file
M plugins/hudson/include/hudson_Widget_JobTestTrend.class.php +15 −6 Go to diff View file
M plugins/hudson/include/hudson_Widget_MyMonitoredJobs.class.php +14 −10 Go to diff View file
M plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php +16 −10 Go to diff View file
A plugins/hudson/phpunit/.simpletest_skip +0 −0 Go to diff View file
A plugins/hudson/phpunit/HudsonJobBuilderTest.php +94 −0 Go to diff View file
A plugins/hudson/phpunit/HudsonJobFactoryTest.php +64 −0 Go to diff View file
A plugins/hudson/phpunit/HudsonJobTest.php +240 −0 Go to diff View file
A plugins/hudson/phpunit/bootstrap.php +21 −0 Go to diff View file
D plugins/hudson/tests/HudsonJobTest.php +0 −291 Go to diff View file