-
Notifications
You must be signed in to change notification settings - Fork 113
Add -only-out-test-toml flag and serialize Env in materialized configs #3881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This change adds a new flag to the acceptance test framework that allows regenerating out.test.toml configuration files without running the actual tests, making it much faster to update test configurations. Changes: - Added -only-out-test-toml flag to libs/testdiff/golden.go - Modified acceptance test runner to skip test execution when flag is set - Added make test-regenerate-configs rule for convenience - Regenerated all out.test.toml files to include materialized config The new workflow is ~100x faster than running tests with -update: - Full test run with -update: several minutes - Config regeneration only: ~2.5 seconds Usage: make test-regenerate-configs Or directly: go test ./acceptance -run '^TestAccept$' -only-out-test-toml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
libs/testdiff/golden.go
Outdated
|
|
||
| func init() { | ||
| flag.BoolVar(&OverwriteMode, "update", false, "Overwrite golden files") | ||
| flag.BoolVar(&OnlyOutTestTomlMode, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add this flag here? It belongs to acceptance_test.go since it's only used there.
Also, can we shorter one, something easier to type? e.g. -only-out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we shorter one, something easier to type? e.g. -only-out
-only-out is ambigious. Does it refer to golden files or the test.toml files? I expect this to be run occasionally since this is only useful to mass update configs. For a single test, these will automatically be updated when the test is run anyways.
22 failing tests:
|
|
Could you condense the PR description? E.g. "Example: New Env Section in out.test.toml" section is not necessary, we can see it in PR diff. |
Summary
This PR:
out.test.tomlconfiguration files without running the actual tests, making it much faster to update test configurations.Envfield, which was previously not serialized. This means allout.test.tomlfiles now capture environment variables that affect test execution.Usage
Using Make target (recommended)
Using go test directly
For a specific test