apache / apache/maven-surefire

[SUREFIRE-1645] Surefire excludedGroups not overriding groups

Open
#2,075 1 comment 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
461
Forks
588
Avg merge
1d 8h
Merged PRs (30d)
19

Description

**[Ulf Lilleengen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=lulf)** opened **[SUREFIRE-1645](https://issues.apache.org/jira/browse/SUREFIRE-1645?redirect=false)** and commented

With maven-surefire-plugin 2.22.1 and junit platform 1.4.0, junit 5 tests that have tags both in the included and excluded groups will always include the tests. This behavior is different when adding the dependency on junit-platform-surefire-provider 1.3.2, which will cause the exclusion to take precedence over the inclusion.

 

Assuming a test is tagged with both tag1 and tag2, the following will run the test:

 

```java
           
                org.apache.maven.plugins
                maven-surefire-plugin
2.22.1
               
                   
                        tag1
                        tag2
                   
               
           
```

 

Whereas the following will not run the test

```java
           
                org.apache.maven.plugins
                maven-surefire-plugin
               
                   
                        tag1
                        tag2
                   
               
               
                 
                    org.junit.platform
                    junit-platform-surefire-provider
                    1.3.2
                 
               
           
```

 

I think the appropriate thing to do is to have exclusion take precedence over inclusion.

---

**Affects:** 2.22.1

1 votes, 2 watchers

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Maven Surefire 2.22.1 configuration with a JUnit 5 test tagged with both tag1 and tag2, comparing behavior with and without junit-platform-surefire-provider 1.3.2. Done means an excluded tag takes precedence and the overlapping test does not run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.