Skip to content
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

add ability to warn or fail a test if a seed is fixed #149

Merged
merged 4 commits into from
Jan 25, 2021

Conversation

osi
Copy link
Contributor

@osi osi commented Jan 20, 2021

introduce a FixedSeedMode that can be set globally (via properties)
or on an individual test. this allows control of using the seed
argument on a property, as it can be undesirable to accidentally commit
a value in this field after reproducing a failure.

fix for #138

introduce a `FixedSeedMode` that can be set globally (via properties)
or on an individual test. this allows control of using the `seed`
argument on a property, as it can be undesirable to accidentally commit
a value in this field after reproducing a failure.
@jlink
Copy link
Collaborator

jlink commented Jan 20, 2021

@osi Do you think it's ready for merging?

@osi
Copy link
Contributor Author

osi commented Jan 21, 2021

I believe it's ready. The CI failure seems like a permission issue of some sort.

@jlink
Copy link
Collaborator

jlink commented Jan 22, 2021 via email

Copy link
Collaborator

@jlink jlink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't find the time I can do the few changes myself.

@@ -55,7 +55,17 @@ public CheckedProperty(
}

public PropertyCheckResult check(Reporting[] reporting) {
PropertyConfiguration effectiveConfiguration = configurationWithEffectiveSeed();
PropertyConfiguration effectiveConfiguration;
try {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this try-catch block has a better place in method configurationWithEffectiveSeed()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with moving into that method is that the try-catch block translates the exception to a PropertyCheckResult.

I extracted the handling of the exception into a helper method, as the same work is done twice. perhaps that's sufficient for now?

@osi
Copy link
Contributor Author

osi commented Jan 23, 2021

If you don't find the time I can do the few changes myself.

I'll take care of them in the next few days. I appreciate the suggestions!

@jlink jlink merged commit 7e7277a into jqwik-team:main Jan 25, 2021
@jlink
Copy link
Collaborator

jlink commented Jan 25, 2021

Many thanks. Going to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants