sageserpent-open / americium

Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15 stars 1 forks source link

Allow a failure reproduction recipe to be specified as a JVM property. #53

Closed sageserpent-open closed 1 year ago

sageserpent-open commented 1 year ago

This introduces a JVM property trials.recipe that does the same thing as trials.recipeHash only with an explicit blob of JSON for the recipe - so it can be cut and pasted from a failing CI build, say.

sageserpent-open commented 1 year ago

If this is implemented, it is worth marking .withRecipe as deprecated, as hacking the code is clunky compared with simply running with a JVM property set as a temporary measure while debugging a test failure.

The tricky bit may be getting the mess of JSON into a JVM property without a whole load of manual escaping of quotes and newlines...

sageserpent-open commented 1 year ago

Completed in commit SHA: 77b9877fea983b3c35cb8da4971beed4388c0566 .

sageserpent-open commented 1 year ago

This isn't complete - sure, the automated tests work, but manual testing forces the escaping of the recipe JSON, which isn't workable. Reopening to provide escaped JSON...

sageserpent-open commented 1 year ago

Now it is - there is an additional section in the report generated by a TrialException that has the recipe JSON in suitably escaped form.

Complete in commit SHA: c3c9de5e8ab9c2487e6cac9bc1a92c60b5f1c8cf .