Comments (11)
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.
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.
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.
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.
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.
Did you enable logging for log level DEBUG when you called maven?
from jqwik.
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.
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.
Hopefully resolved in 87d3184
from jqwik.
You might want to try it in 0.8.13-SNAPSHOT
from jqwik.
Confirming that 0.8.13-SNAPSHOT produces a more helpful message (on INFO level).
from jqwik.
Related Issues (20)
- Consider supporting @UseType for sealed interfaces HOT 8
- Shrinking of large arrays uses a very large amount of memory HOT 11
- StackOverflowError when shrinking large arrays HOT 14
- question: any way to imperatively summon a pre-configured arbitrary? HOT 15
- Make nested groups work for JDK >= 18 HOT 31
- Combinators.combine.as nullability of arguments HOT 4
- Can't figure out how to create an Arbitrary I want HOT 10
- Bug: Arbitraries.strings().uniqueChars() will sometimes shrink to values with duplicate chars HOT 5
- Bug: Uniform Distribution of Integers does not work if range is >= Integer.MAX_VALUE HOT 2
- Kotlin K2 Support HOT 24
- Time Module: Support generating java.sql.Timestamp
- adding `jqwik-kotlin` causes existing tests written in java to fail with NPE HOT 18
- Potential idea for running `SAMPLE_FIRST`/`SAMPLE_ONLY` for stateful tests HOT 2
- Lifecycle method called twice when subclassing HOT 4
- Cannot use Arbitrary.generator() outside jqwik HOT 6
- Is Arbitrary<@Nullable T> correct/intended under JSpecify semantics? HOT 32
- TypeUsage example from user guide fails in 1.8.x HOT 8
- Right Way to Integrate jqwik with DataFaker HOT 23
- Generic @Provide methods are sensitive to the type variables' names HOT 3
- Allowing Sampling of Arbitraries with Injected Seed HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jqwik.