-
-
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
Ability to ignore (or fail) on usage of @Property(seed=) #138
Comments
There’s two aspects here:
1 is crucial for you. 2 is optional, right? |
Correct. My goal is to prevent builds running in certain environments from using a fixed seed. (developer laptop, ok. CI server, no) |
I’m a bit in doubt if a global (overwritable) config is all that helpful. I’ve seen a few codebases where some properties are purposefully fixed to a seed for a reason. Those properties should IMO not lead to failures. What about having a second attribute in @Property, e.g. temporarySeed, which will always log a warning? I’m just rambling. Maybe/probably there are better options to reconcile both scenarios. |
What if the source of the seed for a property was available in a |
@osi Extending the AroundPropertyHook with such a specific trait does not feel adequate. Here's my current suggestion:
What do you think? Maybe jqwik should switch the whole configuration approach to use junit-platform.properties as described |
That suggestion would satisfy my goals. I'm also open to helping switch to use What were you thinking for the migration?
|
thanks - i may try and take it up over my new years break |
Now that configuration is using the platform mechanism, here's the plan:
Setting fixed seed mode for individual test in configuration is currently out of scope. Optional: Add |
got it. i'll pick this up.
…--
(peter.royal|osi)@pobox.com - http://fotap.org/~osi
On Sun, Jan 10, 2021, at 9:14 AM, Johannes Link wrote:
Now that configuration is using the platform mechanism, here's the plan:
* Add configuration parameter
`jqwik.seeds.whenfixed=ALLOW | WARN | FAIL`
* Default value is `ALLOW`
* Mapped on `enum FixedSeedMode`
Setting fixed seed mode for individual test in configuration is currently out of scope.
Optional: Add `whenFixedSeed` attribute to ***@***.***` and ***@***.***` to override global default.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#138 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAE3V77VQQGZ43UPHNQDM3SZHN77ANCNFSM4UOCBVWQ>.
|
This might have to dive in some dirty parts of the engine. If you have ANY doubt how to tackle this, just ask! |
Will do. Capturing the intent has been straightforward. I'm looking to add tests for the actual behavior and believe that |
This feature is available in |
Being able to add the
seed
argument to the@Property
annotation is superb for reproducing failures.However, sometimes they get accidentally committed, which can lead to a CI server runnings tests on a fixed seed.
The ability to ignore or fail on the presence of an explicit seed, for use in CI systems, would help prevent this error.
A system property or environment variable feels to be the easiest to make conditional upon the environment (as users may have
jqwik.properties
committed to SCM)The text was updated successfully, but these errors were encountered: