Skip to content
Permalink
Browse files
[JENKINS-49237] - Update the plugin so that it is testable in PCT
  • Loading branch information
oleg-nenashev committed Jan 30, 2018
1 parent de836b1 commit a4f7dd66e1b37d0eca341032b83e8a3434ee86fe
Showing with 41 additions and 15 deletions.
  1. +13 −7 pom.xml
  2. +1 −4 src/main/java/hudson/plugins/helpers/BuildProxy.java
  3. +3 −2 src/main/java/hudson/plugins/helpers/BuildProxyCallableHelper.java
  4. +2 −1 src/main/java/hudson/plugins/helpers/GraphHelper.java
  5. +0 −1 src/main/java/hudson/plugins/helpers/health/HealthTarget.java
  6. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractBuildReport/largeGraph.jelly
  7. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractBuildReport/normalGraph.jelly
  8. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractBuildReport/reportDetail.jelly
  9. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractProjectReport/largeGraph.jelly
  10. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractProjectReport/normalGraph.jelly
  11. +1 −0 src/main/resources/hudson/plugins/cppncss/AbstractProjectReport/reportDetail.jelly
  12. +1 −0 src/main/resources/hudson/plugins/cppncss/CppNCSSPublisher/config.jelly
  13. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/enlargedGraph.jelly
  14. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/floatingBox.jelly
  15. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/index.jelly
  16. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/largeGraph.jelly
  17. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/normalGraph.jelly
  18. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/reportDetail.jelly
  19. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractBuildAction/summary.jelly
  20. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/enlargedGraph.jelly
  21. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/floatingBox.jelly
  22. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/index.jelly
  23. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/largeGraph.jelly
  24. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/normalGraph.jelly
  25. +1 −0 src/main/resources/hudson/plugins/helpers/AbstractProjectAction/reportDetail.jelly
  26. +1 −0 src/main/resources/index.jelly
  27. +1 −0 src/main/resources/lib/health/row.jelly
20 pom.xml
@@ -2,17 +2,22 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.358</version>
<relativePath>../pom.xml</relativePath>
<version>3.3</version>
</parent>

<artifactId>cppncss</artifactId>
<packaging>hpi</packaging>
<version>1.2-SNAPSHOT</version>
<name>Jenkins CppNCSS plugin</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/CPPNCSS+Plugin</url>
<url>http://wiki.jenkins.io/display/JENKINS/CPPNCSS+Plugin</url>

<properties>
<jenkins.version>1.651.3</jenkins.version>
<java.level>7</java.level>
</properties>

<build>
<plugins>
<plugin>
@@ -32,8 +37,9 @@
</build>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<developers>
@@ -47,14 +53,14 @@
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
@@ -40,7 +40,7 @@
* @param ghostwriter The ghostwriter that will be doing the work for the publisher.
* @param build The build.
* @param listener The build listener.
* @return <code>true</code> if the build can continue.
* @return {@code true} if the build can continue.
* @throws IOException on IOException.
* @throws InterruptedException on InterruptedException.
*/
@@ -183,7 +183,6 @@ public FilePath getArtifactsDir() {

/**
* Root directory of the {@link hudson.model.AbstractBuild} on the master.
* <p/>
* Files related to the {@link hudson.model.AbstractBuild} should be stored below this directory.
*
* @return Root directory of the {@link hudson.model.AbstractBuild} on the master.
@@ -194,7 +193,6 @@ public FilePath getBuildRootDir() {

/**
* Returns the root directory of the checked-out module on the machine where the build executes.
* <p/>
* This is usually where <tt>pom.xml</tt>, <tt>build.xml</tt>
* and so on exists.
*
@@ -206,7 +204,6 @@ public FilePath getExecutionRootDir() {

/**
* Root directory of the {@link hudson.model.AbstractProject} on the master.
* <p/>
* Files related to the {@link hudson.model.AbstractProject} should be stored below this directory.
*
* @return Root directory of the {@link hudson.model.AbstractProject} on the master.
@@ -2,17 +2,18 @@

import hudson.model.BuildListener;
import hudson.remoting.Callable;
import jenkins.security.MasterToSlaveCallable;

import java.io.IOException;

/**
* A helper class that is used when passing Ghostwriter between the slave and master and invoking the appropriate
* actions on the slave or the master.
* actions on the agent or the master node.
*
* @author Stephen Connolly
* @since 28-Jan-2008 22:12:29
*/
class BuildProxyCallableHelper implements Callable<BuildProxy, Exception>{
class BuildProxyCallableHelper extends MasterToSlaveCallable<BuildProxy, Exception> {
// ------------------------------ FIELDS ------------------------------

private final BuildProxy buildProxy;
@@ -1,6 +1,7 @@
package hudson.plugins.helpers;

import hudson.model.AbstractBuild;
import hudson.model.Run;
import hudson.plugins.cppncss.AbstractBuildReport;
import hudson.plugins.cppncss.parser.Statistic;
import hudson.util.ChartUtil;
@@ -233,7 +234,7 @@ private static CategoryDataset buildDataset(AbstractBuild<?, ?> build, DataColle
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();

for (AbstractBuild<?, ?> lastBuild = build; lastBuild != null; lastBuild = lastBuild.getPreviousBuild()) {
ChartUtil.NumberOnlyBuildLabel label = new ChartUtil.NumberOnlyBuildLabel(lastBuild);
ChartUtil.NumberOnlyBuildLabel label = new ChartUtil.NumberOnlyBuildLabel((Run<?, ?>) lastBuild);
AbstractBuildReport action = lastBuild.getAction(AbstractBuildReport.class);
if (action != null) {
builder.add(collector.getCollectedNumber(action), collector.getTitle(), label);
@@ -20,7 +20,6 @@
private final Float fail;
private final Float failNew;

@DataBoundConstructor
public HealthTarget(M metric, String healthy, String unhealthy, String unstable, String fail, String failNew) {
this.metric = metric;
this.fail = safeParse(fail);
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<img src="${relativeUrlPath}graph?width=800&amp;height=600"/>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<img src="${relativeUrlPath}graph"/>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">

@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<img src="${relativeUrlPath}graph?width=800&amp;height=600"/>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<img src="${relativeUrlPath}graph"/>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">

@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:bh="/lib/health">
<f:entry title="CppNCSS xml report pattern"
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:if test="${from.graphActive}">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<t:summary icon="${it.iconFileName}">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:local="local">
<j:if test="${from.graphActive}">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout xmlns:plugin="/hudson/plugins/cppncss/tags">
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
</j:jelly>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
This plugin integrates <a href="http://cppncss.sourceforge.net/">Cpp NCSS reports</a> to Jenkins.
</div>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<!--
One entry

0 comments on commit a4f7dd6

Please sign in to comment.