|
64 | 64 | <JVM_OPTS></JVM_OPTS> |
65 | 65 | <!-- Default excluded groups for tests - can be overridden from command line --> |
66 | 66 | <excludedGroupsForUnitTests>integration,scenario</excludedGroupsForUnitTests> |
| 67 | + <skipUnitTests>false</skipUnitTests> |
| 68 | + <skipIntegrationTests>false</skipIntegrationTests> |
| 69 | + <skipScenarioTests>true</skipScenarioTests> |
67 | 70 | </properties> |
68 | 71 |
|
69 | 72 | <dependencyManagement> |
|
287 | 290 | <destFile>${project.build.directory}/jacoco-it-suffix.exec</destFile> |
288 | 291 | </configuration> |
289 | 292 | </execution> |
| 293 | + <!-- Collect coverage for scenario tests --> |
| 294 | + <execution> |
| 295 | + <id>prepare-agent-scenario</id> |
| 296 | + <goals> |
| 297 | + <goal>prepare-agent</goal> |
| 298 | + </goals> |
| 299 | + <configuration> |
| 300 | + <propertyName>failsafeScenarioArgLine</propertyName> |
| 301 | + <destFile>${project.build.directory}/jacoco-scenario.exec</destFile> |
| 302 | + </configuration> |
| 303 | + </execution> |
290 | 304 | <!-- Merge all coverage data after all integration tests --> |
291 | 305 | <execution> |
292 | 306 | <id>merge-coverage</id> |
|
302 | 316 | <include>jacoco-ut.exec</include> |
303 | 317 | <include>jacoco-it-tagged.exec</include> |
304 | 318 | <include>jacoco-it-suffix.exec</include> |
| 319 | + <include>jacoco-scenario.exec</include> |
305 | 320 | </includes> |
306 | 321 | </fileSet> |
307 | 322 | </fileSets> |
|
333 | 348 | <artifactId>maven-surefire-plugin</artifactId> |
334 | 349 | <version>${maven.surefire.version}</version> |
335 | 350 | <configuration> |
| 351 | + <skipTests>${skipUnitTests}</skipTests> |
336 | 352 | <argLine>@{argLine} ${JVM_OPTS}</argLine> |
337 | 353 | <systemPropertyVariables> |
338 | 354 | <redis-hosts>${redis-hosts}</redis-hosts> |
|
358 | 374 | </systemPropertyVariables> |
359 | 375 | <summaryFile>${project.build.directory}/failsafe-summary.xml</summaryFile> |
360 | 376 | <!-- Default includes used when invoking failsafe goals directly (e.g., mvn failsafe:integration-test) --> |
| 377 | + <excludedGroups>scenario</excludedGroups> |
361 | 378 | <includes> |
362 | 379 | <include>**/*IntegrationTest.java</include> |
363 | 380 | <include>**/*IntegrationTests.java</include> |
364 | 381 | </includes> |
365 | 382 | <excludes> |
366 | 383 | <exclude>**/examples/*.java</exclude> |
367 | | - <exclude>**/scenario/*Test.java</exclude> |
368 | 384 | <!-- Exclude unit tests --> |
369 | 385 | <exclude>**/mocked/*.java</exclude> |
370 | 386 | </excludes> |
|
377 | 393 | <goal>integration-test</goal> |
378 | 394 | </goals> |
379 | 395 | <configuration> |
| 396 | + <skip>${skipIntegrationTests}</skip> |
380 | 397 | <argLine>@{failsafeTaggedArgLine} ${JVM_OPTS}</argLine> |
381 | 398 | <groups>integration</groups> |
| 399 | + <excludedGroups>scenario,unit</excludedGroups> |
382 | 400 | <includes> |
383 | 401 | <include>**/*Test.java</include> |
384 | 402 | <include>**/*Tests.java</include> |
|
392 | 410 | <goal>integration-test</goal> |
393 | 411 | </goals> |
394 | 412 | <configuration> |
| 413 | + <skip>${skipIntegrationTests}</skip> |
395 | 414 | <argLine>@{failsafeSuffixArgLine} ${JVM_OPTS}</argLine> |
396 | | - |
| 415 | + <excludedGroups>scenario,unit</excludedGroups> |
397 | 416 | <includes> |
| 417 | + <include>**/*IT.java</include> |
| 418 | + <include>**/*ITs.java</include> |
398 | 419 | <include>**/*IntegrationTest.java</include> |
399 | 420 | <include>**/*IntegrationTests.java</include> |
400 | 421 | </includes> |
401 | 422 | </configuration> |
402 | 423 | </execution> |
| 424 | + <!-- Run all tests tagged with @Tag("scenario") regardless of file name --> |
| 425 | + <execution> |
| 426 | + <id>scenario-tests</id> |
| 427 | + <goals> |
| 428 | + <goal>integration-test</goal> |
| 429 | + </goals> |
| 430 | + <configuration> |
| 431 | + <skip>${skipScenarioTests}</skip> |
| 432 | + <argLine>@{failsafeScenarioArgLine} ${JVM_OPTS}</argLine> |
| 433 | + <groups>scenario</groups> |
| 434 | + <excludedGroups>integration,unit</excludedGroups> |
| 435 | + <includes> |
| 436 | + <include>**/*IT.java</include> |
| 437 | + <include>**/*ITs.java</include> |
| 438 | + </includes> |
| 439 | + <excludes> |
| 440 | + <!-- ensure plugin level excludes are overridden --> |
| 441 | + </excludes> |
| 442 | + </configuration> |
| 443 | + </execution> |
403 | 444 | <!-- Verify phase should run once after both IT executions --> |
404 | 445 | <execution> |
405 | 446 | <id>it-verify</id> |
|
574 | 615 | </plugins> |
575 | 616 | </build> |
576 | 617 | </profile> |
577 | | - <profile> |
578 | | - <id>tests-with-params</id> |
579 | | - <activation> |
580 | | - <property> |
581 | | - <name>with-param-names</name> |
582 | | - <value>true</value> |
583 | | - </property> |
584 | | - </activation> |
585 | | - <build> |
586 | | - <plugins> |
587 | | - <plugin> |
588 | | - <artifactId>maven-compiler-plugin</artifactId> |
589 | | - <version>3.14.0</version> |
590 | | - <configuration> |
591 | | - <source>1.8</source> |
592 | | - <target>1.8</target> |
593 | | - <parameters>true</parameters> |
594 | | - </configuration> |
595 | | - </plugin> |
596 | | - <plugin> |
597 | | - <artifactId>maven-surefire-plugin</artifactId> |
598 | | - <version>${maven.surefire.version}</version> |
599 | | - <configuration> |
600 | | - <argLine>@{argLine} ${JVM_OPTS}</argLine> |
601 | | - </configuration> |
602 | | - </plugin> |
603 | | - </plugins> |
604 | | - </build> |
605 | | - </profile> |
| 618 | + <profile> |
| 619 | + <id>tests-with-params</id> |
| 620 | + <activation> |
| 621 | + <property> |
| 622 | + <name>with-param-names</name> |
| 623 | + <value>true</value> |
| 624 | + </property> |
| 625 | + </activation> |
| 626 | + <build> |
| 627 | + <plugins> |
| 628 | + <plugin> |
| 629 | + <artifactId>maven-compiler-plugin</artifactId> |
| 630 | + <version>3.14.0</version> |
| 631 | + <configuration> |
| 632 | + <source>1.8</source> |
| 633 | + <target>1.8</target> |
| 634 | + <parameters>true</parameters> |
| 635 | + </configuration> |
| 636 | + </plugin> |
| 637 | + <plugin> |
| 638 | + <artifactId>maven-surefire-plugin</artifactId> |
| 639 | + <version>${maven.surefire.version}</version> |
| 640 | + <configuration> |
| 641 | + <argLine>@{argLine} ${JVM_OPTS}</argLine> |
| 642 | + </configuration> |
| 643 | + </plugin> |
| 644 | + </plugins> |
| 645 | + </build> |
| 646 | + </profile> |
| 647 | + <profile> |
| 648 | + <id>scenario-tests</id> |
| 649 | + <properties> |
| 650 | + <skipUnitTests>true</skipUnitTests> |
| 651 | + <skipIntegrationTests>true</skipIntegrationTests> |
| 652 | + <skipScenarioTests>false</skipScenarioTests> |
| 653 | + </properties> |
| 654 | + </profile> |
606 | 655 |
|
607 | 656 | </profiles> |
608 | 657 | </project> |
0 commit comments