提交 72518634 编写于 作者: K kohsuke

fix up the in-memory layout if we are loading SurefireArchiver as MavenProjectActionBuilder.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@33654 71c3de6d-444a-0410-be80-ed276b4c234a
上级 23e794c3
......@@ -25,6 +25,7 @@ package hudson.maven;
import hudson.FilePath;
import hudson.EnvVars;
import hudson.maven.reporters.SurefireArchiver;
import hudson.slaves.WorkspaceList;
import hudson.slaves.WorkspaceList.Lease;
import hudson.maven.agent.AbortException;
......@@ -93,6 +94,7 @@ public class MavenBuild extends AbstractMavenBuild<MavenModule,MavenBuild> {
public MavenBuild(MavenModule project, File buildDir) throws IOException {
super(project, buildDir);
SurefireArchiver.fixUp(projectActionReporters);
}
@Override
......
/*
* The MIT License
*
* Copyright (c) 2010, InfraDNA, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.maven;
import hudson.model.AbstractProject;
......
......@@ -50,6 +50,8 @@ import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
/**
* Records the surefire test result.
......@@ -129,6 +131,22 @@ public class SurefireArchiver extends MavenReporter {
return true;
}
/**
* Up to 1.372, there was a bug that causes Hudson to persist {@link SurefireArchiver} with the entire test result
* in it. If we are loading those, fix it up in memory to reduce the memory footprint.
*
* It'd be nice we can save the record to remove problematic portion, but that might have
* additional side effect.
*/
public static void fixUp(List<MavenProjectActionBuilder> builders) {
if (builders==null) return;
for (ListIterator<MavenProjectActionBuilder> itr = builders.listIterator(); itr.hasNext();) {
MavenProjectActionBuilder b = itr.next();
if (b instanceof SurefireArchiver)
itr.set(new FactoryImpl());
}
}
/**
* Part of the serialization data attached to {@link MavenBuild}.
*/
......
/*
* The MIT License
*
* Copyright (c) 2010, InfraDNA, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.maven.reporters;
import hudson.maven.MavenBuild;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册