apache / apache/maven-surefire

[SUREFIRE-1895] config maven to mark “running test” as ERROR when some tests are skipped

Open
#2,956 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Jan](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kowalski)** opened **[SUREFIRE-1895](https://issues.apache.org/jira/browse/SUREFIRE-1895?redirect=false)** and commented

As a tester/developer I would like to have a flag in maven to set final verdict of running tests to ERROR when some tests has been skipped.

Flag name proposal:

failIfAnyTestSkipped

Example using:

mvn test -failIfAnyTestSkipped=false

 

```
[WARNING] Tests run: 1423, Failures: 0, Errors: 0, **Skipped: 3,** Time elapsed: 149.449 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 1423, Failures: 0, Errors: 0, Skipped: 3
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] **BUILD SUCCESS**
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:55 min
[INFO] Finished at: 2021-03-10T13:12:35+01:00
[INFO] ------------------------------------------------------------------------
```

mvn test -failIfAnyTestSkipped=true

 

```
[WARNING] Tests run: 1423, Failures: 0, Errors: 0, **Skipped: 3,** Time elapsed: 149.449 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 1423, Failures: 0, Errors: 0, Skipped: 3
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] **BUILD ERROR**
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:55 min
[INFO] Finished at: 2021-03-10T13:12:35+01:00
[INFO] ------------------------------------------------------------------------
```

 

---
No further details from [SUREFIRE-1895](https://issues.apache.org/jira/browse/SUREFIRE-1895?redirect=false)

Contributor guide

Open the contributing guide

Research direction

The issue names the `mvn test` command and SUREFIRE-1895; start by reading that JIRA record and locating the Surefire Maven-plugin entry point that handles skipped-test results. Done means the proposed flag is accepted with both values and the build result matches the requested behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.