hedy icon indicating copy to clipboard operation
hedy copied to clipboard

[TESTS] Adds random tests generator

Open jpelay opened this issue 3 years ago • 3 comments

Description

A while ago @Felienne had the idea of combining the different commands in a level, rather randomly, in order to be able to test a wider set of possible programs. In this PR, I add a new random case generator that works like this:

In order to be able to generate programs, we can supply individual blocks of self contained programs in a dictionary that has this structure:

programs = {'test_name': ['hedy program', 'python_program']}

Then among all of the tests in the program dictionary we pick one randomly. If it needs indentation we handle it using a stack of indented blocks, and the number of lines that are still available to use.

Fixes #988

Always link the number of the issue or of the discussion that your pr concerns.

How to test I'm still working on adding the tests for the all of the other levels, that's why this PR is a draft, but I'd like if you like can have a look :)

Checklist Done? Check if you have it all in place using this list:*

  • [x] Describes changes in the format above (present tense)
  • [x] Links to an existing issue or discussion
  • [x] Has a "How to test" section

If you're unsure about any of these, don't hesitate to ask. We're here to help!

jpelay avatar Jul 19 '22 22:07 jpelay

This pull request has not received any attention in 60 days. If you want to keep this PR open, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Sep 20 '22 09:09 github-actions[bot]

Hi @jpelay, do we want to keep this open or try the same approach in a new PR (since this is a bit behind?)

Ah never mind, there were no conflicts in updating so we can keep this one alive!

Felienne avatar Sep 25 '22 21:09 Felienne

Hi @jpelay, do we want to keep this open or try the same approach in a new PR (since this is a bit behind?)

Ah never mind, there were no conflicts in updating so we can keep this one alive!

Hi! Yeah, sorry! Thank you for keeping it alive! Ill take responsibility for keeping it alive from now on!

jpelay avatar Sep 30 '22 13:09 jpelay