Add comprehensive golden tests for DAG ASCII rendering#153
Merged
Conversation
Add 20 golden test cases covering various DAG patterns: - Basic: single, embedded_action, truncated_long_names, linear chains - Divergence: 2-3 branches, uneven step counts - Convergence: 2-3 parents, uneven step counts, multi-child - Complex: diamond, hourglass - Parallel: independent roots, independent chains - Mixed: standalone jobs, children-first sorting, wide divergence Golden files are stored in testdata/dag_ascii/*.golden.txt and can be updated with UPDATE_GOLDEN=1 go test -run TestDagAsciiRenderer_Golden Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive golden testing for the DagAsciiRenderer with 20 test cases covering various DAG patterns. The golden files provide regression protection for the ASCII rendering output and serve as visual documentation of supported patterns.
Changes:
- Added 20 golden test files covering basic, divergence, convergence, complex, parallel, and mixed DAG patterns
- Added package-level documentation with test case table and usage instructions
- Implemented
TestDagAsciiRenderer_Goldenwith support for updating golden files viaUPDATE_GOLDEN=1
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dag_ascii_test.go | Added golden test infrastructure with 20 test cases and comprehensive package documentation |
| testdata/dag_ascii/*.golden.txt | Golden files for all 20 test cases showing expected ASCII rendering output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Code Metrics Report
Details | | main (acd8986) | #153 (fee7090) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 54.4% | 54.6% | +0.2% |
| Files | 63 | 63 | 0 |
| Lines | 6375 | 6375 | 0 |
+ | Covered | 3469 | 3483 | +14 |
- | Code to Test Ratio | 1:1.0 | 1:1.0 | -0.1 |
| Code | 12570 | 12570 | 0 |
- | Test | 13547 | 13180 | -367 |
+ | Test Execution Time | 24s | 12s | -12s |Code coverage of files in pull request scope (87.9% → 93.2%)
Reported by octocov |
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
DagAsciiRenderercovering comprehensive DAG patternstestdata/dag_ascii/*.golden.txtTest Cases
Test plan
go test -run TestDagAsciiRenderer_Golden -v- all 20 tests passgo test ./...🤖 Generated with Claude Code