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)
- Move to a jumpable random generator to avoid statistical depenency between map, flatMap, chain, etc calls HOT 8
- ActionChain failure include never-executed actions since it uses wrong state object when creating transformations HOT 1
- ActionChain shrink should be called only with state objects that correspond to the relevant state position HOT 31
- Cache LifecycleMethods results: findBeforeTryMethods, findAfterTryMethods, etc HOT 1
- severalStepsToList_withReversedOrderOfSuppliers sometimes runs into StackOverflowError HOT 4
- BigIntegerGrower.tryNumberTypeCasts spends significant time in ClassCastException
- Prefer for loop in CombinedShrinkable#createValues for better stacktrace readability HOT 5
- Issue with multiple lists from suppliers HOT 7
- Bug: Shrink and Grow across parameters should respect that parameters are generated by the same arbitrary HOT 1
- Regress from 1.5.5 to 1.5.6 and still present in 1.7.1: Cannot inject List<Consumer<T>> HOT 4
- Add API to automatically generate a regression test based on the property failure HOT 4
- generated arbitrary list from fixed inputs HOT 2
- Javadocs and source files are missing on Central HOT 2
- Make IgnoreException "attempts" (and other related hard coded values) configurable HOT 11
- Allow to define a scope/lifespan with @Provide methods HOT 7
- Support UniqueElements annotation for Extensions HOT 1
- Bug: PropertyExecutor.execute() does not handle AssertionErrors correctly HOT 1
- ClassCastException when using Combinators during shrinking HOT 21
- ListArbitrary<T> providers are not selected to resolve List<T> parameters HOT 1
- Support OpenJML for Arbitraries
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.