Add templating support for dynamic test generation#63
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…eration Agent-Logs-Url: https://github.com/coreruleset/ftw-tests-schema/sessions/c9565eb4-e3d7-416d-b7bc-b743a46e99a2 Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add dynamic tests feature to go-ftw
Add templating support for dynamic test generation
Apr 30, 2026
theseion
requested changes
May 1, 2026
Member
|
@copilot apply changes based on this comment: #63 (comment) |
Agent-Logs-Url: https://github.com/coreruleset/ftw-tests-schema/sessions/4391b55c-0118-4480-8df1-cd4bf8cca5e7 Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Collaborator
|
I love it ❤️. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the test schema to support "dynamic tests" — tests that expand into multiple instances via the cross-product of template variable values, eliminating repetitive test definitions for things like URI or payload word lists.
Schema changes
TemplateDefinitiontype — defines a named template variable (key) and its possiblevaluestemplatesfield onTest— optional list ofTemplateDefinitionentries; when present, the test is expanded into N×M×… instances (one per combination){{ .varname }}The above generates 4 test instances (2 URIs × 2 commands).
Other changes
spec/v2.4.0/— new spec directory with regenerated JSON schemas reflecting the updated typesexamples.go— addedExampleTemplateTest,ExampleTemplates, and supporting example values