Skip to content

Add YAML and param-file golden tests#55

Merged
apstndb merged 3 commits into
mainfrom
test/yaml-golden-fixtures
Jun 28, 2026
Merged

Add YAML and param-file golden tests#55
apstndb merged 3 commits into
mainfrom
test/yaml-golden-fixtures

Conversation

@apstndb

@apstndb apstndb commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add golden tests for --format=yaml output via encodeResultSetYAML (jq + newEncoder).
  • Add embedded --param-file fixtures and consolidate LoadParamFile tests.
  • Add full PROFILE ResultSet JSON snapshots with multiple jq filter goldens.
  • Extend -update-golden to cover YAML output goldens.

Test plan

  • go test ./...
  • CI green

Made with Cursor

Cover --param-file parsing with embedded fixtures, synthetic ResultSet
YAML goldens, and full PROFILE JSON snapshots with jq filter variants.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive golden file testing for YAML output and Spanner profile JSON-to-YAML conversions, alongside refactoring parameter loading tests to use external YAML fixtures. Feedback on the changes highlights two important improvements: first, ensuring that the encoder in yaml_golden_test.go is properly closed if it implements a Close method to guarantee all buffered data is flushed; second, rebinding the loop variable tc in params/fixtures_test.go to prevent variable capture issues when running subtests in parallel.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread yaml_golden_test.go
Comment thread params/fixtures_test.go
Co-authored-by: Cursor <cursoragent@cursor.com>
@apstndb

apstndb commented Jun 28, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive YAML golden tests and parameter file loading tests. It refactors existing tests in params/load_test.go by moving inline YAML definitions into dedicated fixture files under params/testdata/. Additionally, it adds new test suites in profile_yaml_test.go and yaml_golden_test.go to verify the conversion of Spanner profile JSONs and result sets into YAML format against golden files. Feedback on the changes suggests pinning loop variables inside the test loops in profile_yaml_test.go and yaml_golden_test.go to prevent potential concurrency bugs and ensure consistency across the test suite.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread profile_yaml_test.go
Comment thread yaml_golden_test.go
Co-authored-by: Cursor <cursoragent@cursor.com>
@apstndb apstndb merged commit 4d2abf6 into main Jun 28, 2026
2 checks passed
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.

1 participant