Skip to content

Add templating support for dynamic test generation#63

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dynamic-tests-feature
Draft

Add templating support for dynamic test generation#63
Copilot wants to merge 3 commits into
mainfrom
copilot/add-dynamic-tests-feature

Conversation

Copilot AI commented Apr 30, 2026

Copy link
Copy Markdown

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

  • New TemplateDefinition type — defines a named template variable (key) and its possible values
  • templates field on Test — optional list of TemplateDefinition entries; when present, the test is expanded into N×M×… instances (one per combination)
  • Input fields may reference template variables using Go template syntax: {{ .varname }}
tests:
  - test_id: 1
    templates:
      - key: uri
        values:
          - /get
          - /get?foo=bar
      - key: command
        values:
          - php
          - php%20foo
    stages:
      - input:
          uri: "{{ .uri }}"
          method: POST
          data: "cmd={{ .command }}"
        output:
          log:
            expect_ids: [932160]

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 types
  • examples.go — added ExampleTemplateTest, ExampleTemplates, and supporting example values

Copilot AI linked an issue Apr 30, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 773306e0-de93-40b0-baf4-db412f77bb97

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/add-dynamic-tests-feature

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Add dynamic tests feature to go-ftw Add templating support for dynamic test generation Apr 30, 2026
Copilot AI requested a review from fzipi April 30, 2026 19:54
Comment thread types/types.go Outdated
@fzipi

fzipi commented May 2, 2026

Copy link
Copy Markdown
Member

@copilot apply changes based on this comment: #63 (comment)

Copilot finished work on behalf of fzipi May 2, 2026 16:56
@theseion

theseion commented May 3, 2026

Copy link
Copy Markdown
Collaborator

I love it ❤️.

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.

Make "dynamic tests" a feature of go-ftw

3 participants