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

UI/UX improvements #53

Merged
merged 9 commits into from
Dec 19, 2024
Merged

Conversation

bbyalcinkaya
Copy link
Member

@bbyalcinkaya bbyalcinkaya commented Dec 11, 2024

Added the following command line arguments:

  • --max-examples MAX_EXAMPLES: Maximum number of inputs for fuzzing (default: 100)
  • --id ID: Name of the test function in the testing contract
  • --directory DIRECTORY, -C DIRECTORY: The working directory for the command (defaults to the current working directory).

@bbyalcinkaya bbyalcinkaya requested a review from gtrepta December 12, 2024 14:26
@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review December 12, 2024 14:26
@bbyalcinkaya bbyalcinkaya marked this pull request as draft December 16, 2024 14:54
@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review December 17, 2024 12:08
Comment on lines 50 to 52
_exec_test(wasm=wasm, id=args.id)
if args.max_examples < 1:
raise ValueError(f'--max-examples must be a positive integer (greater than 0), given {args.max_examples}')
_exec_test(wasm=wasm, max_examples=args.max_examples, id=args.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to run unlimited examples? I think this option ends up getting sent to hypothesis, it might have support for supplying 0 or -1 for that, you'll have to check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hypothesis complains when it is less than 1:

hypothesis.errors.InvalidArgument: max_examples=-1 should be at least one. You can disable example generation with the `phases` setting instead.

See: https://github.com/HypothesisWorks/hypothesis/blob/d377752a2e98b86e65f49af86895c767a662f994/hypothesis-python/src/hypothesis/_settings.py#L366

Comment on lines +241 to 244
def deploy_and_run(
self, contract_wasm: Path, child_wasms: tuple[Path, ...], max_examples: int = 100, id: str | None = None
) -> None:
"""Run all of the tests in a soroban test contract.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the docstrings.

@bbyalcinkaya bbyalcinkaya requested a review from gtrepta December 19, 2024 10:35
@automergerpr-permission-manager automergerpr-permission-manager bot merged commit dcf6f8f into master Dec 19, 2024
3 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the ui-ux-improvements branch December 19, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants