Add visual regression tests with golden files for console rendering #8794
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.
Implements visual regression testing using
github.com/charmbracelet/x/exp/goldento prevent unintended formatting changes in console output components (tables, boxes, trees, error messages).Changes
Golden test suite (
pkg/console/golden_test.go)Makefile target:
make update-goldenregenerates golden files after intentional formatting changesDocumentation (
specs/visual-regression-testing.md)Example
Golden files capture plain-text output (non-TTY) for consistency across environments. Tests fail with unified diff when rendering changes unexpectedly.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
4d63.comCo-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> http�� ithub-script/git/ref/tags/v8 infocmp 6/x64/bin/node t/gh-aw/git/ref/git go` (dns block)
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.