Skip to content

Commit a294031

Browse files
committed
Added random test execution parameter
1 parent 4800ed1 commit a294031

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

README.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ Please refer to the following usage example for the parameters descriptions.
102102
<path>schema_name</path>
103103
</paths>
104104

105-
<!-- A list of tags to run. -->
106-
<tags>
107-
<tag>test_tag</tag>
108-
</tags>
109-
110105
<sources>
111106
<source>
112107
<!-- Path to project source files. -->
@@ -140,6 +135,16 @@ Please refer to the following usage example for the parameters descriptions.
140135
<!-- Skip the utPLSQL version compatibility check. -->
141136
<!-- Defaults to: false -->
142137
<skipCompatibilityCheck>false</skipCompatibilityCheck>
138+
139+
<!-- A list of tags to run. -->
140+
<tags>
141+
<tag>test_tag</tag>
142+
</tags>
143+
144+
<!-- Enables random order of test executions. -->
145+
<randomTestOrder>true</randomTestOrder>
146+
<!-- Sets the seed to use for random test execution order. If set, it sets -random to true. -->
147+
<randomTestOrderSeed>5</randomTestOrderSeed>
143148

144149
<!-- Comma-separated object list to include in the coverage report. -->
145150
<!-- Format: [schema.]package[,[schema.]package ...]. -->
@@ -209,7 +214,6 @@ Please refer to the following usage example for the parameters descriptions.
209214
<customMapping>package_bodies</customMapping>
210215
</customTypeMapping>
211216
</testsCustomTypeMapping>
212-
213217
</configuration>
214218
</execution>
215219
</executions>
@@ -231,13 +235,15 @@ More project samples are available in the src/test/resources directory:
231235
| --- | --- | --- |
232236
| -c | --color | |
233237
| | --failure-exit-code | |
234-
| | | ignoreFailure |
238+
| -p | --path | paths.path |
235239
| -f | --format | reporters.reporter.name |
236240
| -o | | reporters.reporter.fileOutput |
237241
| -s | | reporters.reporter.consoleOutput |
238-
| -p | --path | paths.path |
239-
| | --tags | tags.tag |
242+
| | | ignoreFailure |
240243
| -scc | --skip-compatibility-check | skipCompatibilityCheck |
244+
| | --tags | tags.tag |
245+
| -r | --random-test-order | randomTestOrder |
246+
| -seed | --random-test-order-seed | randomTestOrderSeed |
241247
| -exclude | | excludeObject |
242248
| -include | | includeObject |
243249
| | | |

src/main/java/org/utplsql/maven/plugin/UtPLSQLMojo.java

+8
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public class UtPLSQLMojo extends AbstractMojo {
118118
@Parameter
119119
private Set<String> tags = new LinkedHashSet<>();
120120

121+
@Parameter
122+
private boolean randomTestOrder;
123+
124+
@Parameter
125+
private Integer randomTestOrderSeed;
126+
121127
@Parameter(defaultValue = "${project.build.directory}", readonly = true)
122128
protected String targetDir;
123129

@@ -165,6 +171,8 @@ public void execute() throws MojoExecutionException {
165171
.skipCompatibilityCheck(skipCompatibilityCheck)
166172
.colorConsole(colorConsole)
167173
.addTags(tags)
174+
.randomTestOrder(randomTestOrder)
175+
.randomTestOrderSeed(randomTestOrderSeed)
168176
.failOnErrors(!ignoreFailure);
169177

170178
if (StringUtils.isNotBlank(excludeObject)) {

0 commit comments

Comments
 (0)