Skip to content

Commit

Permalink
removed pipelines as they can be easily configured by multiple 'findT…
Browse files Browse the repository at this point in the history
…ext' invocations, updated tests
  • Loading branch information
sparkoo committed Jun 12, 2019
1 parent abc4cf2 commit 0dd8e1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/main/java/hudson/plugins/textfinder/TextFinderModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.io.Serializable;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

public final class TextFinderModel extends AbstractDescribableImpl<TextFinderModel>
Expand Down Expand Up @@ -69,7 +68,6 @@ public boolean isAlsoCheckConsoleOutput() {
return alsoCheckConsoleOutput;
}

@Symbol("finder")
@Extension
public static class DescriptorImpl extends Descriptor<TextFinderModel> {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public void lastFinderWins() throws Exception {
new CpsFlowDefinition(
String.format(
"node('%s') {isUnix() ? sh('echo foobar') : bat(\"prompt \\$G\\r\\necho foobar\")}\n"
+ "node('%s') {findText regexp: 'foobar', alsoCheckConsoleOutput: true, "
+ "textFinders: ["
+ "finder(regexp: 'foobar', unstableIfFound: true, alsoCheckConsoleOutput: true),"
+ "finder(regexp: 'foobar', notBuiltIfFound: true, alsoCheckConsoleOutput: true)"
+ "]}",
+ "node('%s') {"
+ "findText regexp: 'foobar', alsoCheckConsoleOutput: true\n"
+ "findText regexp: 'foobar', unstableIfFound: true, alsoCheckConsoleOutput: true\n"
+ "findText regexp: 'foobar', notBuiltIfFound: true, alsoCheckConsoleOutput: true\n"
+ "}",
agent.getNodeName(), agent.getNodeName())));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ public void lastFinderWins() throws Exception {
project.setDefinition(
new CpsFlowDefinition(
"node {isUnix() ? sh('echo foobar') : bat(\"prompt \\$G\\r\\necho foobar\")}\n"
+ "node {findText regexp: 'foobar', alsoCheckConsoleOutput: true, "
+ "textFinders: ["
+ "finder(regexp: 'foobar', unstableIfFound: true, alsoCheckConsoleOutput: true),"
+ "finder(regexp: 'foobar', notBuiltIfFound: true, alsoCheckConsoleOutput: true)"
+ "]}"));
+ "node {"
+ "findText regexp: 'foobar', alsoCheckConsoleOutput: true\n"
+ "findText regexp: 'foobar', unstableIfFound: true, alsoCheckConsoleOutput: true\n"
+ "findText regexp: 'foobar', notBuiltIfFound: true, alsoCheckConsoleOutput: true\n"
+ "}"));
WorkflowRun build = project.scheduleBuild2(0).get();
rule.waitForCompletion(build);
rule.assertLogContains("Checking console output", build);
Expand Down

0 comments on commit 0dd8e1b

Please sign in to comment.