Repository navigation
Test generator - #3186
Test generator#3186jagdish-15 wants to merge 11 commits into
Conversation
|
This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested. If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos. For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping |
kahgoh
left a comment
There was a problem hiding this comment.
Nice work! I think this looks pretty good! I have some comments below. I was also wondering if you have tried running it and seeing if there is much of a diff between the existing tests and the generated tests? I'm wondering if we'll be able to use [no important files change] for the first sync.
|
|
||
| public static String toMethodName(String description) { | ||
| if (description == null || description.isBlank()) { | ||
| return "testMethod"; |
There was a problem hiding this comment.
Would it better to throw some kind of exception? If we just return testMethod, there is the possibility of multiple descriptions that is either null or blank.
There was a problem hiding this comment.
We should add execute permission on this file so that Git makes this executable when cloned and checked out (see https://dev.to/antozanini/how-to-mark-a-file-as-executable-in-a-git-repo-1ml0)
There was a problem hiding this comment.
Similar to another comment, we should add the execute permission for this script in the Git repository.
Yep, I did! |
Summary
Adds an automated JUnit 5 test generator CLI tool (
./bin/generate-tests) and custom Handlebars templates for exercises requiring track-specific signatures.Changes
test-generator/: CLI tool to fetch canonical data fromproblem-specifications, apply.meta/tests.toml, and generate formatted JUnit 5 tests..meta/template.hbsfor practice exercises with non-standard APIs/signatures.simple-cipherreference solution,clocktest consolidation intoClockTest.java, andlist-opsfoldLeftargument order.Usage