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 option to configure JGiven by a simple properties file #271

Closed
janschaefer opened this issue Dec 24, 2016 · 8 comments · Fixed by #679
Closed

add option to configure JGiven by a simple properties file #271

janschaefer opened this issue Dec 24, 2016 · 8 comments · Fixed by #679

Comments

@janschaefer
Copy link
Contributor

there should be a way to configure JGiven by just providing a single jgiven.properties file.

@jsalinaspolo
Copy link
Contributor

@janschaefer what would you like to configure ?

@l-1squared
Copy link
Collaborator

@janschaefer is this still an issue? Because I don't know what you possibly would want to configure either?

@janschaefer
Copy link
Contributor Author

For example, the report directory where the JSONs are generated when running a JGiven test (jgiven.report.dir). For other potential configuration values see com.tngtech.jgiven.impl.Config. Typically, these settings are configured in the Maven or Gradle plugin, however, when you execute the tests from the IDE, these settings are ignored. Having a properties file would allow JGiven to read these settings even if executed from the IDE.

@ninj
Copy link
Contributor

ninj commented May 29, 2021

👍
Upvoting this, as it is somewhat annoying to have to tell people about this particular quirk as we use maven a lot.
I spent a while trying to see if I could configure jgiven.report.dir via a junit extension to no avail.
The workaround of least-resistance is to accept that the default report directory jgiven-reports/json will be created if tests are run from the IDE and add /jgiven-reports to .gitignore.

@l-1squared
Copy link
Collaborator

Hi @ninj thanks for your input. Comments like this help me figure out which of the issues are important. I received a couple of such request in recent times, hence I need to prioritize them. As such some patience on your side will be appreciated :)

@ninj
Copy link
Contributor

ninj commented Jun 6, 2021

I created an initial implementation for this to help kick things off.

@l-1squared l-1squared linked a pull request Jul 20, 2021 that will close this issue
@ninj
Copy link
Contributor

ninj commented Jul 24, 2021

Hi, sorry I've not been in touch for a while!

Just had an interesting thought - what should happen if the maven or gradle plugins are configured differently than the config file?

At the moment there isn't any warning/error, but perhaps a warning could be emitted when the plugin runs?

Would be helpful in avoiding support issues where users encounter unexpected behaviour (but did configure the behaviour in the first place.)

edit: I guess the same conflict is there with the plugins and system property config too.

@l-1squared
Copy link
Collaborator

@ninj,

Hi, excellent question, and one I've been pondering for a while as well. In the end, I opted to just keep the behavior as is, because, as you said, the same problem, that you may have deactivated JGiven via system properties, while requesting a report via the plugins, already existed. As you may see in PR #679, I've added a note to the user guide to help prevent that surprise.

However, I am quite fond of having a warning in the plugins that test for deactivation. I hope I can get this done & tested in a reasonable amount of time :)

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

Successfully merging a pull request may close this issue.

4 participants