Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ The TNS alias used in the connect string must match the alias of the credential
Format: --coverage-schemes=schema1[,schema2[,schema3]]

--ora-stuck-timeout - Sets a timeout around Reporter creation and retries when not ready after a while. 0 = no timeout.

--no-support-info - Leaves out the utPLSQL support line from the documentation, TAP and HTML coverage reports.
Requires utPLSQL framework 3.2.4 or newer. Default: the line is printed
```

Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>

<utplsql-java-api.version>3.2.5</utplsql-java-api.version>
<utplsql-java-api.version>3.2.6-SNAPSHOT</utplsql-java-api.version>

<junit.jupiter.version>5.12.2</junit.jupiter.version>
<picocli.version>4.7.7</picocli.version>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/utplsql/cli/RunAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

private static final Logger logger = LoggerFactory.getLogger(RunAction.class);

private RunCommandConfig config;

Check warning on line 39 in src/main/java/org/utplsql/cli/RunAction.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this private field "final", it is never reassigned.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL-cli&issues=AaIx7YXQGzjp9lsPRcPz&open=AaIx7YXQGzjp9lsPRcPz&pullRequest=235

private CompatibilityProxy compatibilityProxy;
private ReporterFactory reporterFactory;
Expand Down Expand Up @@ -171,7 +171,8 @@
.excludeSchemaExpr(config.getExcludeSchemaExpr())
.includeObjectExpr(config.getIncludeObjectExpr())
.excludeObjectExpr(config.getExcludeObjectExpr())
.oraStuckTimeout(config.getOraStuckTimeout());
.oraStuckTimeout(config.getOraStuckTimeout())
.supportInfo(config.isSupportInfo());
}

private void outputMainInformation() {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/utplsql/cli/RunPicocliCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ FileMapperConfig toFileMapperConfig() {
@Option(names = "--ora-stuck-timeout", description = "Sets a timeout around Reporter creation and retries when not ready after a while. 0 = no timeout.")
Integer oraStuckTimeout = 0;

@Option(
names = {"--no-support-info"},
description = "Leaves out the utPLSQL support line from the documentation, TAP and HTML coverage reports. " +
"Requires utPLSQL framework 3.2.4 or newer"
)
private boolean noSupportInfo = false;

private RunAction runAction;

private String[] splitOrEmpty(String value) {
Expand Down Expand Up @@ -281,6 +288,7 @@ public RunCommandConfig getRunCommandConfig() {
.excludeSchemaExpr(excludeSchemaExpr)
.includeObjectExpr(includeObjectExpr)
.excludeObjectExpr(excludeObjectExpr)
.supportInfo(!noSupportInfo)
.create();
}

Expand Down
16 changes: 13 additions & 3 deletions src/main/java/org/utplsql/cli/config/RunCommandConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
private final String excludeSchemaExpr;
private final String includeObjectExpr;
private final String excludeObjectExpr;
private boolean supportInfo = true;

@ConstructorProperties({"connectString", "suitePaths", "reporters", "outputAnsiColor", "failureExitCode", "skipCompatibilityCheck", "includePackages", "excludePackages", "sourceMapping", "testMapping", "logConfigLevel", "timeoutInMinutes", "dbmsOutput", "randomTestOrder", "randomTestOrderSeed", "tags", "coverageSchemes", "oraStuckTimeout", "includeSchemaExpr", "excludeSchemaExpr", "includeObjectExpr", "excludeObjectExpr"})
public RunCommandConfig(String connectString, String[] suitePaths, ReporterConfig[] reporters, boolean outputAnsiColor, Integer failureExitCode, boolean skipCompatibilityCheck, String[] includePackages, String[] excludePackages, FileMapperConfig sourceMapping, FileMapperConfig testMapping, ConfigLevel logConfigLevel, Integer timeoutInMinutes, boolean dbmsOutput, boolean randomTestOrder, Integer randomTestOrderSeed, String[] tags, String[] coverageSchemes, Integer oraStuckTimeout, String includeSchemaExpr, String excludeSchemaExpr, String includeObjectExpr, String excludeObjectExpr) {
@ConstructorProperties({"connectString", "suitePaths", "reporters", "outputAnsiColor", "failureExitCode", "skipCompatibilityCheck", "includePackages", "excludePackages", "sourceMapping", "testMapping", "logConfigLevel", "timeoutInMinutes", "dbmsOutput", "randomTestOrder", "randomTestOrderSeed", "tags", "coverageSchemes", "oraStuckTimeout", "includeSchemaExpr", "excludeSchemaExpr", "includeObjectExpr", "excludeObjectExpr", "supportInfo"})
public RunCommandConfig(String connectString, String[] suitePaths, ReporterConfig[] reporters, boolean outputAnsiColor, Integer failureExitCode, boolean skipCompatibilityCheck, String[] includePackages, String[] excludePackages, FileMapperConfig sourceMapping, FileMapperConfig testMapping, ConfigLevel logConfigLevel, Integer timeoutInMinutes, boolean dbmsOutput, boolean randomTestOrder, Integer randomTestOrderSeed, String[] tags, String[] coverageSchemes, Integer oraStuckTimeout, String includeSchemaExpr, String excludeSchemaExpr, String includeObjectExpr, String excludeObjectExpr, boolean supportInfo) {

Check warning on line 34 in src/main/java/org/utplsql/cli/config/RunCommandConfig.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Constructor has 23 parameters, which is greater than 7 authorized.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL-cli&issues=AaIx7YZRGzjp9lsPRcP0&open=AaIx7YZRGzjp9lsPRcP0&pullRequest=235
super(connectString);
this.suitePaths = suitePaths;
this.reporters = reporters;
Expand All @@ -53,6 +54,7 @@
this.excludeSchemaExpr = excludeSchemaExpr;
this.includeObjectExpr = includeObjectExpr;
this.excludeObjectExpr = excludeObjectExpr;
this.supportInfo = supportInfo;
}

public String[] getSuitePaths() {
Expand Down Expand Up @@ -129,6 +131,8 @@

public String getExcludeObjectExpr() { return excludeObjectExpr; }

public boolean isSupportInfo() { return supportInfo; }

public static class Builder {

private String connectString;
Expand All @@ -153,6 +157,7 @@
private String excludeSchemaExpr;
private String includeObjectExpr;
private String excludeObjectExpr;
private boolean supportInfo = true;

public Builder connectString(String connectString) {
this.connectString = connectString;
Expand Down Expand Up @@ -264,8 +269,13 @@
return this;
}

public Builder supportInfo(boolean supportInfo) {
this.supportInfo = supportInfo;
return this;
}

public RunCommandConfig create() {
return new RunCommandConfig(connectString, suitePaths, reporters, outputAnsiColor, failureExitCode, skipCompatibilityCheck, includePackages, excludePackages, sourceMapping, testMapping, logConfigLevel, timeoutInMinutes, dbmsOutput, randomTestOrder, randomTestOrderSeed, tags, coverageSchemes, oraStuckTimeout, includeSchemaExpr, excludeSchemaExpr, includeObjectExpr, excludeObjectExpr);
return new RunCommandConfig(connectString, suitePaths, reporters, outputAnsiColor, failureExitCode, skipCompatibilityCheck, includePackages, excludePackages, sourceMapping, testMapping, logConfigLevel, timeoutInMinutes, dbmsOutput, randomTestOrder, randomTestOrderSeed, tags, coverageSchemes, oraStuckTimeout, includeSchemaExpr, excludeSchemaExpr, includeObjectExpr, excludeObjectExpr, supportInfo);
}
}
}
4 changes: 3 additions & 1 deletion src/test/java/org/utplsql/cli/PicocliRunCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void runCommandAllArguments() throws Exception {
"-include-schema-expr=^APP$",
"-exclude-schema-expr=^APP_TEST$",
"-include-object-expr=^PKG_",
"-exclude-object-expr=_TMP$");
"-exclude-object-expr=_TMP$",
"--no-support-info");

assertNotNull(config.getConnectString());
assertThat( config.getSuitePaths(), is(new String[]{"app.betwnstr", "app.basic"}));
Expand All @@ -62,6 +63,7 @@ void runCommandAllArguments() throws Exception {
assertEquals( "^APP_TEST$", config.getExcludeSchemaExpr() );
assertEquals( "^PKG_", config.getIncludeObjectExpr() );
assertEquals( "_TMP$", config.getExcludeObjectExpr() );
assertFalse( config.isSupportInfo() );
assertTrue( config.isOutputAnsiColor() );
assertEquals( LoggerConfiguration.ConfigLevel.NONE, config.getLogConfigLevel());
assertEquals( 10, config.getFailureExitCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class RunCommandConfigParamsArePassedToTestRunnerTest {
Expand Down Expand Up @@ -54,4 +55,21 @@ void expressionFilters() {
assertThat( testRunner.getOptions().includeObjectExpr, equalTo("^PKG_") );
assertThat( testRunner.getOptions().excludeObjectExpr, equalTo("_TMP$") );
}

@Test
void supportInfoIsOnByDefault() {
RunCommandConfig config = new RunCommandConfig.Builder()
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertTrue( testRunner.getOptions().supportInfo );
}

@Test
void supportInfoSwitchedOff() {
RunCommandConfig config = new RunCommandConfig.Builder()
.supportInfo(false)
.create();
TestRunner testRunner = new RunAction(config).newTestRunner(new ArrayList<>());
assertFalse( testRunner.getOptions().supportInfo );
}
}
Loading