Move validator comparisons to validgen-benchmarks - #118
Merged
Merged
Conversation
The benchmarks and the color helper check were the only imports of go-playground/validator, so this module no longer requires it.
Contributor
There was a problem hiding this comment.
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.
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.
Summary
TestColorMatchesValidatorthere too. It was the remaining import ofgithub.com/go-playground/validator/v10, so this module can drop that requirement.VALIDGEN_BENCHMARKS_DIRis set.make testgenrunsgo run .socoverage_test.gois not passed to the generator.Fixes #44
Test plan
go test ./internal/... ./types/... ./testgen/make endtoendtestsgo mod tidyleaves no directgithub.com/go-playground/validator/v10requirementmake smoke(package tests plus one iteration of each comparison side)make testgen VALIDGEN_BENCHMARKS_DIR=...rewrites the comparative files identical to the copies taken frommain