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

Allow no default test dirs in config. #257

Merged
merged 1 commit into from
Aug 4, 2020
Merged

Conversation

smarlowucf
Copy link
Collaborator

It is helpful when a user has a non default test dir in config to also set no default test dirs to true to prevent test file conflicts and not require the option in command line.

It is helpful when a user has a non default test dir in
config to also set no default test dirs to true to prevent test
file conflicts and not require the option in command line.
@@ -58,7 +59,8 @@
'log_level': logging.INFO,
'results_dir': IPA_RESULTS_PATH,
'test_files': set(),
'timeout': 600
'timeout': 600,
'no_default_test_dirs': False
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 if we use FALSE here then the other values should be True instead of None. Having the double negation makes things cumbersome ;)

Copy link
Collaborator Author

@smarlowucf smarlowucf Aug 3, 2020

Choose a reason for hiding this comment

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

Change to default_test_dirs or use_default_test_dirs? That seems good but it is a breaking API change.

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 we are OK breaking the API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem with that change is this arg is a flag. If the flag is provided it's set to True but by default it's none. There would be no way to turn off default directories from command line in the positive case because a default of False at the CLI prevents the value from being set in config.

If we don't want double negative I prefer multiple changes:

  • By default img-proof uses default test directories. (same)
  • By default if a custom set of test directories is provided only that list is used. (change)
  • If a custom list is provided and the user still wants to include the default ones then passing or setting use_default_test_dirs would make this happen. (change)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong button at first.

I am OK with the double negative, just pointing out that it requires a bit of extra mental work. It would be nice to have consistent settings, i.e. either use True/False or None/1 for example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From command line perspective it's either set or not so there's no hoops to jump through. And if you set it in the config file any possible truthy value will be true and vice versa.

So the distutils method that is parsing this would accept and properly handle things like; 0, 1, true, false, T, F, True, False etc. I think that's relatively user friendly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ack and will note the concern but I think this is good as is for now.

@smarlowucf smarlowucf merged commit 1f89bee into master Aug 4, 2020
@smarlowucf smarlowucf deleted the no-default-dirs branch August 4, 2020 21:36
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.

2 participants