Skip to content

fix: fake version for snapshot testing - #314

Merged
kxxt merged 1 commit into
mainfrom
fix-fake-ver
Aug 29, 2026
Merged

kxxt merged 1 commit into
mainfrom
fix-fake-ver

Conversation

@kxxt

@kxxt kxxt commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Tests
    • Updated terminal rendering snapshots to use the actual displayed application version.
    • Improved test consistency by sharing the version value used in title rendering.

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tracexec Ready Ready Preview Aug 29, 2026 2:57pm

@greptile-apps

greptile-apps Bot commented Aug 29, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves snapshot version stabilization into the TUI renderer so tests render a fixed version while non-test builds continue using the package version.

  • Adds a test-only TRACEXEC_VERSION constant with the production value selected outside tests.
  • Removes post-render string replacement from the two application snapshot tests.
  • Updates both snapshots to reflect the renderer’s actual fixed-version output.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

Test builds now render a deterministic version directly, production builds retain the real package version, and the affected snapshots are updated consistently.

Important Files Changed

Filename Overview
crates/tracexec-tui/src/app/ui.rs Selects a stable fake version under test configuration while preserving the Cargo package version in production builds.
crates/tracexec-tui/src/app.rs Removes brittle snapshot-output replacement now that version stabilization occurs during rendering.
crates/tracexec-tui/src/snapshots/tracexec_tui__app__tests__snapshot_app_render.snap Updates the default-theme snapshot to match direct rendering of the fixed test version.
crates/tracexec-tui/src/snapshots/tracexec_tui__app__tests__snapshot_app_render_with_custom_theme.snap Updates the custom-theme snapshot to match direct rendering of the fixed test version.

Reviews (1): Last reviewed commit: "fix: fake version for snapshot testing" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: d464ad77-ca8e-45cf-87f7-a70ff555fd6b

📥 Commits

Reviewing files that changed from the base of the PR and between 677d5ca and ce64f19.

⛔ Files ignored due to path filters (2)
  • crates/tracexec-tui/src/snapshots/tracexec_tui__app__tests__snapshot_app_render.snap is excluded by !**/*.snap
  • crates/tracexec-tui/src/snapshots/tracexec_tui__app__tests__snapshot_app_render_with_custom_theme.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • crates/tracexec-tui/src/app.rs
  • crates/tracexec-tui/src/app/ui.rs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The TUI now uses a shared version constant for title rendering. Tests define a fake version at compile time, and snapshot tests no longer replace version text in rendered output.

Changes

Version Rendering

Layer / File(s) Summary
Version constant and title integration
crates/tracexec-tui/src/app/ui.rs
TRACEXEC_VERSION uses a test-specific value during tests and the package version otherwise. The application title reads this constant.
Snapshot rendering updates
crates/tracexec-tui/src/app.rs
Removed the output replacement helper. Both render snapshots now format the terminal buffer directly.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to ce64f

Tests now use a fixed display version for stable snapshots while production continues to show the package version. The change is localized and introduces no actionable merge-blocking risk beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: using a fake version for snapshot testing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-fake-ver

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.47%. Comparing base (99daab7) to head (ce64f19).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #314      +/-   ##
==========================================
- Coverage   82.52%   82.47%   -0.06%     
==========================================
  Files          84       84              
  Lines       21399    21393       -6     
==========================================
- Hits        17659    17643      -16     
- Misses       3740     3750      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kxxt
kxxt merged commit fc84e6b into main Aug 29, 2026
25 of 27 checks passed
@kxxt
kxxt deleted the fix-fake-ver branch August 29, 2026 15:15

This branch was successfully deployed

1 active deployment
Preview — ce64f199 Deployed Aug 29, 2026 by vercel[bot]
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