-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Replace jqwik.properties with JUnit Platform Mechanism for Configuration #139
Comments
On property naming, the JUnit Jupiter documentation does dot-separated lowercase. they use |
On the first discussion point, agreed. I was thinking of storing the configuration as a property on |
- the is a prereq for jqwik-team#139 - defer loading of config until test discovery - store config as part of the root descriptor
That doesn’t feel right to me because it requires a descriptor to be mutable. Descriptors were designed to be immutable; I think there are places where this is no longer the case but I wouldn’t do it if I can prevent it. |
@osi Just had a look at the PR to realise that mutability is NOT required. Your approach looks unusual at first sight (because it stores additional info in the descriptor) but let’s see where it will lead you. It may also be worthwhile to look how Jupiter is doing it. |
Jupiter also stores the configuration as a property of the root descriptor. |
- the is a prereq for #139 - defer loading of config until test discovery - store config as part of the root descriptor
The PR has been merged and released in "1.4.0-SNAPSHOT" |
@osi There's one minor thing that I couldn't track down quickly: All logging done during configuration loading seems to appear twice when running tests, e.g.
Is there a straightforward way to prevent duplicate logging? Maybe configuration loading must be lazy and cached? |
I'll take a look. |
@osi The double logging comes from JUnit Platform itself, called by IntelliJ. One of the two is the culprit. |
Testing Problem
jqwik has its own way to configure itself:
jqwik.properties
. This has a couple of disadvantages:Suggested Solution
Switch to the configuration mechanism built into the JUnit platform.
For versions 1.4.x the old mechanism must be kept for backwards compatibility.
The first implementation step should cover:
jqwik.properties
or fromjunit-platform.properties
with an additional "jqwik." prefixjqwik.properties
will log a WARNINGjunit-platform.properties
has precedencejunit-platform.properties
(log an ERROR if old name is used there)jqwik.properties
intojunit-platform.properties
Discussion
Currently jqwik gets its configuration when creating the instance of
JqwikTestEngine
.The
ConfigurationParameters
instance is only available in discovery and execution requests.Maybe a first step should move the retrieval of
JqwikConfiguration
into the request methods tofacilitate migration.
JUnit's
ConfigurationParameters
interface does not provide a means to get all parameters with a certain prefix.That means that it will no longer be possible to warn about unused/unknown parameters (e.g. through spelling errors).
Should camel case names be replaced by names with hyphens or underscores?
The text was updated successfully, but these errors were encountered: