Skip to content

Test generator - #3186

Merged
kahgoh merged 11 commits into
exercism:mainfrom
jagdish-15:test-generator
Nov 30, 2026
Merged

kahgoh merged 11 commits into
exercism:mainfrom
jagdish-15:test-generator

Conversation

@jagdish-15

Copy link
Copy Markdown
Member

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 from problem-specifications, apply .meta/tests.toml, and generate formatted JUnit 5 tests.
  • Templates: Added .meta/template.hbs for practice exercises with non-standard APIs/signatures.
  • Fixes: Minor fixes in simple-cipher reference solution, clock test consolidation into ClockTest.java, and list-ops foldLeft argument order.

Usage

# Build & install
cd test-generator && ./gradlew installDist

# Generate tests
./bin/generate-tests -e <exercise-slug>
./bin/generate-tests -a

@github-actions

Copy link
Copy Markdown
Contributor

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.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@jagdish-15
jagdish-15 requested a review from kahgoh November 24, 2026 12:28
@jagdish-15
jagdish-15 requested review from kahgoh and removed request for kahgoh November 27, 2026 12:58

@kahgoh kahgoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread test-generator/README.md Resolved
Comment thread test-generator/gradlew Resolved
Comment thread bin/generate-tests Resolved
@jagdish-15

Copy link
Copy Markdown
Member Author

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.

Yep, I did!
There wasn't much of a difference except the formatting stuff. We can safely use [no important files change].
(Not so sure about simple cipher though, that was the only one where the actual test got changed)

@kahgoh kahgoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@kahgoh
kahgoh merged commit e3b3258 into exercism:main Nov 30, 2026
14 checks passed
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