Skip to content

Add comprehensive golden tests for DAG ASCII rendering#153

Merged
linyows merged 2 commits intomainfrom
add-dag-ascii-golden-tests
Jan 18, 2026
Merged

Add comprehensive golden tests for DAG ASCII rendering#153
linyows merged 2 commits intomainfrom
add-dag-ascii-golden-tests

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Jan 18, 2026

Summary

  • Add 20 golden test cases for DagAsciiRenderer covering comprehensive DAG patterns
  • Add godoc documentation with test case table and usage instructions
  • Golden files stored in testdata/dag_ascii/*.golden.txt

Test Cases

Category Cases
Basic single, embedded_action, truncated_long_names, linear_two, linear_three
Divergence divergence_two, divergence_three, divergence_uneven_steps
Convergence convergence_two, convergence_three, convergence_uneven_steps, multi_child_convergence
Complex diamond, hourglass
Parallel parallel_roots, parallel_chains
Mixed mixed_standalone, sorted_children_first, wide_divergence

Test plan

  • Run go test -run TestDagAsciiRenderer_Golden -v - all 20 tests pass
  • Verify golden files are correctly generated
  • Run full test suite go test ./...

🤖 Generated with Claude Code

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>
@github-actions

This comment has been minimized.

@linyows linyows requested a review from Copilot January 18, 2026 01:14
@github-actions

This comment has been minimized.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_Golden with support for updating golden files via UPDATE_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>
@github-actions

This comment has been minimized.

@github-actions
Copy link

Code Metrics Report

main (acd8986) #153 (fee7090) +/-
Coverage 54.4% 54.6% +0.2%
Code to Test Ratio 1:1.0 1:1.0 -0.1
Test Execution Time 24s 12s -12s
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%)

Files Coverage +/- Status
dag_ascii.go 93.2% +5.2% affected

Reported by octocov

@linyows linyows merged commit 028ef05 into main Jan 18, 2026
7 checks passed
@linyows linyows deleted the add-dag-ascii-golden-tests branch January 18, 2026 01:23
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.

2 participants