Skip to content

Move validator comparisons to validgen-benchmarks - #118

Merged
leocavalcante merged 2 commits into
mainfrom
44-move-validator-benchmarks
Sep 30, 2026
Merged

leocavalcante merged 2 commits into
mainfrom
44-move-validator-benchmarks

Conversation

@leocavalcante

Copy link
Copy Markdown
Member

Summary

  • Move the ValidGen vs go-playground/validator benchmarks, including the handwritten baseline, to opencodeco/validgen-benchmarks.
  • Move TestColorMatchesValidator there too. It was the remaining import of github.com/go-playground/validator/v10, so this module can drop that requirement.
  • TestGen writes the comparative suite into that checkout when VALIDGEN_BENCHMARKS_DIR is set. make testgen runs go run . so coverage_test.go is not passed to the generator.

Fixes #44

Test plan

  • go test ./internal/... ./types/... ./testgen/
  • make endtoendtests
  • go mod tidy leaves no direct github.com/go-playground/validator/v10 requirement
  • In validgen-benchmarks, make smoke (package tests plus one iteration of each comparison side)
  • make testgen VALIDGEN_BENCHMARKS_DIR=... rewrites the comparative files identical to the copies taken from main

The benchmarks and the color helper check were the only imports of go-playground/validator, so this module no longer requires it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The benchmark migration, dependency cleanup, generator behavior, and documentation are consistent and complete.

Review effort: Balanced
Findings: None

What changed in this PR

Moves validator comparison benchmarks and compatibility checks to validgen-benchmarks, removing the main module’s validator dependency.

Changes:

  • Removes local comparative benchmark suites and templates.
  • Adds optional cross-repository benchmark generation via VALIDGEN_BENCHMARKS_DIR.
  • Updates dependencies and documentation for the new workflow.
File Description
types/​color.go Links the color comparison location.
types/​color_test.go Replaces dependency-based comparison with local smoke tests.
tests/​cmpbenchtests/​generated_cmp_perf_no_pointer_test.go Removes generated comparisons.
tests/​bench/​validgen_test.go Removes local ValidGen benchmark.
tests/​bench/​validator_test.go Removes validator benchmark.
tests/​bench/​validator__.go Removes generated benchmark validator.
tests/​bench/​types.go Removes benchmark models.
tests/​bench/​manual_coding.go Removes handwritten baseline.
tests/​bench/​manual_coding_test.go Removes baseline benchmark tests.
testgen/​README.md Documents external generation.
testgen/​generate_cmp_perf_tests.go Writes comparisons into the external checkout.
testgen/​cmp_perf_pointer_tests.tpl Removes relocated pointer template.
testgen/​cmp_perf_no_pointer_tests.tpl Removes relocated value template.
README.md Redirects benchmark usage and results.
Makefile Removes local benchmark targets and updates TestGen.
go.sum Removes obsolete dependency checksums.
go.mod Drops validator and promotes x/text.
docs/​internals.md Documents cross-repository TestGen behavior.
.github/​copilot-instructions.md Updates contributor benchmark guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The migration, generator behavior, dependency cleanup, and documentation are consistent with the stated objective.

Review effort: Balanced
Findings: None

@leocavalcante
leocavalcante merged commit f23390d into main Sep 30, 2026
5 checks passed
@leocavalcante
leocavalcante deleted the 44-move-validator-benchmarks branch September 30, 2026 19:30
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.

Move benchmark tests between ValidGen and GoValidator to another repository

2 participants