Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-27392] Using SimpleBuildWrapper.createLoggerDecorator from C…
…oreWrapperStep.

Originally-Committed-As: 874c4618f43316e096562499f0f6a3636951919a
  • Loading branch information
jglick committed Mar 31, 2015
1 parent fe9fd58 commit 60cb607
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -51,7 +51,6 @@
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runners.model.Statement;
Expand Down Expand Up @@ -165,7 +164,6 @@ public static class OneVarWrapper extends SimpleBuildWrapper {
}
}

@Ignore("TODO test prepared")
@Issue("JENKINS-27392")
@Test public void loggerDecorator() throws Exception {
story.addStep(new Statement() {
Expand Down
Expand Up @@ -29,6 +29,7 @@
import hudson.Extension;
import hudson.FilePath;
import hudson.Launcher;
import hudson.console.ConsoleLogFilter;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.tasks.BuildWrapperDescriptor;
Expand Down Expand Up @@ -76,6 +77,10 @@ public static final class Execution extends AbstractStepExecutionImpl {
if (!overrides.isEmpty()) {
bodyInvoker.withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new ExpanderImpl(overrides)));
}
ConsoleLogFilter filter = step.delegate.createLoggerDecorator(run);
if (filter != null) {
bodyInvoker.withContext(BodyInvoker.mergeConsoleLogFilters(getContext().get(ConsoleLogFilter.class), filter));
}
SimpleBuildWrapper.Disposer disposer = c.getDisposer();
bodyInvoker.withCallback(disposer != null ? new Callback(disposer) : BodyExecutionCallback.wrap(getContext())).start();
return false;
Expand Down

0 comments on commit 60cb607

Please sign in to comment.