/** * @since 2.1.0 */ @Override protected void customizeBuildVariables(final Map<String, String> vars) { AxisList axes = getParent().getParent().getAxes(); for (Map.Entry<String,String> e : getParent().getCombination().entrySet()) { Axis a = axes.find(e.getKey()); if (a!=null) { a.addBuildVariable(e.getValue(),vars); }else { vars.put(e.getKey(), e.getValue()); } } }
protected Lease getParentWorkspaceLease(Node n, WorkspaceList wsl) throws InterruptedException, IOException { MatrixProject mp = getParent().getParent(); String customWorkspace = mp.getCustomWorkspace(); if (customWorkspace != null) { final FilePath nodeRoot = n.getRootPath(); if (nodeRoot == null) { throw new IOException("Cannot retrieve the node's root. Most probably it's offline"); } // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(nodeRoot.child(getEnvironment(listener).expand(customWorkspace))); } final FilePath workspace = n.getWorkspaceFor(mp); if (workspace == null) { throw new IOException("Cannot retrieve the node's workspace for " + mp + ". Most probably the node is offline"); } return wsl.allocate(workspace, getParentBuild()); }
/** * @since 2.1.0 */ @Override protected void customizeBuildVariables(final Map<String, String> vars) { AxisList axes = getParent().getParent().getAxes(); for (Map.Entry<String,String> e : getParent().getCombination().entrySet()) { Axis a = axes.find(e.getKey()); if (a!=null) { a.addBuildVariable(e.getValue(),vars); }else { vars.put(e.getKey(), e.getValue()); } } }
@Override public Map<String,String> getBuildVariables() { Map<String,String> r = super.getBuildVariables(); // pick up user axes AxisList axes = getParent().getParent().getAxes(); for (Map.Entry<String,String> e : getParent().getCombination().entrySet()) { Axis a = axes.find(e.getKey()); if (a!=null) a.addBuildVariable(e.getValue(),r); else r.put(e.getKey(), e.getValue()); } return r; }
/** * @since 2.1.0 */ @Override protected void customizeBuildVariables(final Map<String, String> vars) { AxisList axes = getParent().getParent().getAxes(); for (Map.Entry<String, String> e : getParent().getCombination().entrySet()) { Axis a = axes.find(e.getKey()); if (a != null) { a.addBuildVariable(e.getValue(), vars); } else { vars.put(e.getKey(), e.getValue()); } } }
/** * @since 2.1.0 */ @Override protected void customizeBuildVariables(final Map<String, String> vars) { AxisList axes = getParent().getParent().getAxes(); for (Map.Entry<String,String> e : getParent().getCombination().entrySet()) { Axis a = axes.find(e.getKey()); if (a!=null) { a.addBuildVariable(e.getValue(),vars); }else { vars.put(e.getKey(), e.getValue()); } } }
public boolean apply(@Nullable MatrixRun run) { if (run == null) { return false; } if (StringUtils.isBlank(getCombinationFilter())) { // no combination filter stands for all children. return true; } Combination c = run.getParent().getCombination(); AxisList axes = run.getParent().getParent().getAxes(); return c.evalGroovyExpression(axes, getCombinationFilter()); } }
/** * Gets the {@link MatrixBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. */ public MatrixBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the {@link MatrixBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. */ public MatrixBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the {@link MatrixBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. */ public MatrixBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the {@link MatrixBuild} that has the same build number. * * @return null if no such build exists, which happens when the module build * is manually triggered. */ public MatrixBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
/** * Gets the {@link MatrixBuild} that has the same build number. * * @return * null if no such build exists, which happens when the module build * is manually triggered. */ public MatrixBuild getParentBuild() { return getParent().getParent().getBuildByNumber(getNumber()); }
@Override public String getDisplayName() { StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) { List<Ancestor> ancs = req.getAncestors(); for( int i=1; i<ancs.size(); i++) { if(ancs.get(i).getObject()==this) { if(ancs.get(i-1).getObject() instanceof MatrixBuild) { return getParent().getCombination().toCompactString(getParent().getParent().getAxes()); } } } } return super.getDisplayName(); }
@Override public String getDisplayName() { StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) { List<Ancestor> ancs = req.getAncestors(); for( int i=1; i<ancs.size(); i++) { if(ancs.get(i).getObject()==this) { if(ancs.get(i-1).getObject() instanceof MatrixBuild) { return getParent().getCombination().toCompactString(getParent().getParent().getAxes()); } } } } return super.getDisplayName(); }
@Override public String getDisplayName() { StaplerRequest req = Stapler.getCurrentRequest(); if (req != null) { List<Ancestor> ancs = req.getAncestors(); for (int i = 1; i < ancs.size(); i++) { if (ancs.get(i).getObject() == this) { if (ancs.get(i - 1).getObject() instanceof MatrixBuild) { return getParent().getCombination().toCompactString(getParent().getParent().getAxes()); } } } } return super.getDisplayName(); }
@Override public String getDisplayName() { StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) { List<Ancestor> ancs = req.getAncestors(); for( int i=1; i<ancs.size(); i++) { if(ancs.get(i).getObject()==this) { if(ancs.get(i-1).getObject() instanceof MatrixBuild) { return getParent().getCombination().toCompactString(getParent().getParent().getAxes()); } } } } return super.getDisplayName(); }
@Override public String getDisplayName() { StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) { List<Ancestor> ancs = req.getAncestors(); for( int i=1; i<ancs.size(); i++) { if(ancs.get(i).getObject()==this) { if(ancs.get(i-1).getObject() instanceof MatrixBuild) { return getParent().getCombination().toCompactString(getParent().getParent().getAxes()); } } } } return super.getDisplayName(); }
@Override public boolean endRun(final MatrixRun run) throws InterruptedException, IOException { List<WarningsResultAction> actions = run.getActions(WarningsResultAction.class); if (!actions.isEmpty()) { for (WarningsResultAction action : actions) { initializeParser(action.getParser()); ParserResult aggregation = totalsPerParser.get(action.getParser()); String configurationName = run.getParent().getName(); WarningsResult result = action.getResult(); addAllWarnings(aggregation, result, configurationName); aggregation.addModules(appendConfigurationNameToModule(result, configurationName)); } } return true; }
/** * Asserts that the outcome of the build is a specific outcome. */ public <R extends Run> R assertBuildStatus(Result status, R r) throws Exception { if(status==r.getResult()) return r; // dump the build output in failure message String msg = "unexpected build status; build log was:\n------\n" + getLog(r) + "\n------\n"; if(r instanceof MatrixBuild) { MatrixBuild mb = (MatrixBuild)r; for (MatrixRun mr : mb.getRuns()) { msg+="--- "+mr.getParent().getCombination()+" ---\n"+getLog(mr)+"\n------\n"; } } assertEquals(msg, status,r.getResult()); return r; }
/** * Asserts that the outcome of the build is a specific outcome. */ public <R extends Run> R assertBuildStatus(Result status, R r) throws Exception { if(status==r.getResult()) return r; // dump the build output in failure message String msg = "unexpected build status; build log was:\n------\n" + getLog(r) + "\n------\n"; if(r instanceof MatrixBuild) { MatrixBuild mb = (MatrixBuild)r; for (MatrixRun mr : mb.getRuns()) { msg+="--- "+mr.getParent().getCombination()+" ---\n"+getLog(mr)+"\n------\n"; } } assertEquals(msg, status,r.getResult()); return r; }