@Ignore in combination with --tests, bug or "feature"

I have this build.gradle file:

apply plugin: 'java'

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.+'
}

I have this non-ignored test file:

import org.junit.Test;
import static org.junit.Assert.*;

public class TestOne {
    @Test
    public void one() {
        assertTrue(true);
    }
}

And this “ignored” one:

import org.junit.*;
import static org.junit.Assert.*;

@Ignore
public class TestTwo {
    @Test
    public void two() {
        assertTrue(true);
    }
}

When running “gradlew clean test --tests TestOne”, TestTwo shows up in the reports as ignored (which is technically correct). But why does TestTwo show up at all in the reports since my “–tests” filter certainly doesn’t match it?

As an aside, IDEA also shows the ignored test when using the “run as a gradle test” option.

The filter is applied while running the tests vs when the test runner finds the possible test classes. So it’s a feature. The test filter isn’t necessarily file based and could include a filter at a method level.

It seems a bit inconsistent. If I change TestOne to be:

import org.junit.*;
import static org.junit.Assert.*;

public class TestOne {
    @Test
    public void oneA() {
        assertTrue(true);
    }

    @Ignore
    @Test
    public void oneB() {
        assertTrue(true);
    }
}

Then running with --tests TestOne.oneA runs everything I expect (oneA) but doesn’t show oneB as ignored but does show TestTwo as ignored.

Hrm, this seems to be something quirky on the JUnit side. We’re supplying the filter, but JUnit is giving us the skipped/passed feedback.