Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: improve error message when test is filtered out #16029

Open
melix opened this issue Feb 4, 2021 · 6 comments
Open

UX: improve error message when test is filtered out #16029

melix opened this issue Feb 4, 2021 · 6 comments
Labels
a:bug in:testing re:comprehensibility reasonable errors and warnings, clear dsl, mental overload

Comments

@melix
Copy link
Contributor

melix commented Feb 4, 2021

Context

This caused me a headache which has hopefully been mitigated thanks to the help of @rieske . Basically, if a test task is configured to filter out tests:

    register<SmokeTest>("smokeTest") {
        description = "Runs Smoke tests"
        configureForSmokeTest(*santaProjects)
        useJUnitPlatform {
            filter {
                excludeTestsMatching(gradleBuildTestPattern)
            }
        }
    }

and that you run via CLI, or in my case, via the IDE, this test task, you get this error message:

> No tests found for given includes: [org.gradle.smoketests.GradleBuildConfigurationCacheSmokeTest](filter.includeTestsMatching)

which is not quite correct: tests were found, but they were filtered out. So it's not a bug in the engine not finding the test, it's actually that I was calling the wrong task.

Suggestion:

> No tests were executed for given includes: [org.gradle.smoketests.GradleBuildConfigurationCacheSmokeTest](filter.includeTestsMatching) but the following tests were found and ignored by a filter on the task configuration:
   - org.gradle.smoketests.GradleBuildConfigurationCacheSmokeTest
@ldaley
Copy link
Member

ldaley commented Feb 4, 2021

The experience is similar when using --tests. The feedback is close to incomprehensible.

@melix
Copy link
Contributor Author

melix commented Feb 5, 2021

Yes, this is the very same issue: when you run a test from IDEA like I did, it actually uses --tests and the fact Gradle tells you that the test you just started doesn't exist is... frustrating.

@jjohannes jjohannes removed the @core Issue owned by GBT Core label Mar 22, 2021
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Apr 17, 2022
@melix
Copy link
Contributor Author

melix commented Apr 17, 2022

ping

@stale stale bot removed the stale label Apr 17, 2022
@sschuberth
Copy link
Contributor

Actually, I believe the "No tests found for given includes" message is fine. It all boils down to who you think "found" refers to: To the test engine, or to Gradle. To me it refers to Gradle, as the message comes from Gradle. So Gradle did not "find" the test (because it was filtered), but the test engine did find it.

Anyway, what I believe is more confusing than that is that the message talks about "includes" although only an exclude was defined. Maybe better use a wording like "No tests to execute remaining after filtering".

@lingocoder
Copy link
Contributor

The experience is similar when using --tests. The feedback is close to incomprehensible

Can confirm :(

@ov7a ov7a added the re:comprehensibility reasonable errors and warnings, clear dsl, mental overload label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:testing re:comprehensibility reasonable errors and warnings, clear dsl, mental overload
Projects
None yet
Development

No branches or pull requests

6 participants