Giter Club home page Giter Club logo

Comments (11)

jlink avatar jlink commented on July 20, 2024

TLDR

It's just a warning that the classes IdentifierEqualsContract and IdentifierLiteralContract are being tried as test containers but they are not. The warning can be ignored.

Longer Explanation

The maven option "-Dtest=org.example.*.java" instructs maven to consider all types (classes and interfaces) that match the pattern as potential test containers. That's why maven sends a "resolve as test class" request to jqwik (or any other registered test engine). Maven is behaving according to contract in this case.

Since those contract classes are interfaces they are not considered to be valid test containers by jqwik on their own. They are however considered by jqwik as supertypes of the *Properties classes.

It should be possible to change the "-Dtest=..." pattern in a way to only include classes that end with "Properties" (my adhoc attempty to do that sadly failed though).

Possible Changes in jqwik

What would you consider a better warning message to make the explanation above more obvious?

from jqwik.

tmohme avatar tmohme commented on July 20, 2024

Thank you for the explanation.
For me, what you wrote in the "TLDR" section of your comment would be sufficient.
Something like jqwik was instructed to try class 'x.y.z' as a test container, but it is not (a test container on its own).
The current message Class 'x.y.z' could not be resolved creates the fear that the tests might not be executed as expected and thus leave you uncovered.
Also the severity could be changed from warning to info if the message can (always) safely be ignored (= there's no need to act upon it).
Personally I regard warning message as important enough to investigate their meaning/impact, while info messages can safely be ignored.

from jqwik.

stse avatar stse commented on July 20, 2024

Also from me thank you for your explanation.

I would like to suggest that nothing is logged at all in such cases, because nobody would expect that such interfaces/classes are treated as tests or is the message logged by maven or surefire?

from jqwik.

jlink avatar jlink commented on July 20, 2024

Well, it might be an important information that a test engine cannot resolve a class that's supposed to be a test container. AFAI, jupiter

What about using log level INFO?

Just checked: Jupiter is using log level DEBUG in those cases. The wording, however, is the same: "Class '%s' could not be resolved."

from jqwik.

stse avatar stse commented on July 20, 2024

I think the question is: Should the classes which contain only a contract and not an executable test be treated as test containers?. I have forked @tmohme's example (see https://github.com/stse-zuehlke-com/jqwik-warning) and migrated it to plain junit 5 in order to check how jupiter handles such contract interfaces in this case. When I execute "mvn clean test -Dtest=org.example.*.java" then jupiter handles these interfaces as non test containers without logging a warning or an info.

from jqwik.

jlink avatar jlink commented on July 20, 2024

Did you enable logging for log level DEBUG when you called maven?

from jqwik.

stse avatar stse commented on July 20, 2024

Good question. Nope. But also if I execute "mvn clean test -Dtest=org.example.*.java" with "-X" there are not any debug messages regarding these classes.

from jqwik.

jlink avatar jlink commented on July 20, 2024

Jupiter is doing logging through some additional redirection for reasons not obvious to me.

Anyway, what I will do is change the log level to INFO and adapt the message to something hopefully more understandable like:

request to resolve class 'x.y.z' as a test container, but it is not a container or does not contain tests

from jqwik.

jlink avatar jlink commented on July 20, 2024

Hopefully resolved in 87d3184

from jqwik.

jlink avatar jlink commented on July 20, 2024

You might want to try it in 0.8.13-SNAPSHOT

from jqwik.

tmohme avatar tmohme commented on July 20, 2024

Confirming that 0.8.13-SNAPSHOT produces a more helpful message (on INFO level).

from jqwik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.