← Back to list

sync-test-binary
by tercen
Plot operator using ggrs
⭐ 0🍴 0📅 Jan 23, 2026
SKILL.md
name: sync-test-binary description: Update test binaries (test_stream_generator.rs) to match the latest architecture from main.rs, ensuring they use the same caching, rendering, and pagination patterns. Use when test binaries need to be synchronized with production code. allowed-tools: Read, Edit, Bash, Grep
Sync Test Binary Architecture
Synchronize test binaries with the latest architecture patterns from main.rs.
Step 1: Extract Architecture Patterns from main.rs
Read src/main.rs and identify current patterns:
- Cache creation - Look for DataCache::new() before page loop
- Cache conditions - Check
page_values.len() > 1logic - PlotRenderer creation - Look for new_with_cache() usage
- Cache cleanup - Find cache.clear() after page loop
Step 2: Identify Test Binary
Find test binary at src/bin/test_stream_generator.rs
Step 3: Compare and Find Gaps
Compare test binary with main.rs patterns:
- Missing DataCache creation?
- Still using PlotRenderer::new() instead of new_with_cache()?
- Missing cache cleanup?
Step 4: Apply Cache Creation Pattern
Location: Before the page loop (after page_values extraction)
Add this code:
// Create shared disk cache for all pages (only if multiple pages)
use ggrs_core::stream::DataCache;
let cache = if page_values.len() > 1 {
let cache = DataCache::new(&workflow_id, &step_id)?;
println!(" Created disk cache at /tmp/ggrs_cache_{}_{}/", workflow_id, step_id);
Some(cache)
} else {
println!(" Single page - cache disabled");
None
};
Step 5: Update PlotRenderer Creation
Location: Where PlotRenderer::new() is called
Replace:
let renderer = PlotRenderer::new(&plot_gen, plot_width as u32, plot_height as u32);
With:
// Create PlotRenderer with cache (if enabled)
let renderer = if let Some(ref cache_ref) = cache {
PlotRenderer::new_with_cache(&plot_gen, plot_width as u32, plot_height as u32, cache_ref.clone())
} else {
PlotRenderer::new(&plot_gen, plot_width as u32, plot_height as u32)
};
Step 6: Add Cache Cleanup
Location: After the page loop ends
Add this code:
// Clean up cache directory after all pages are rendered
if let Some(ref cache_ref) = cache {
println!(" Cleaning up disk cache...");
cache_ref.clear()?;
}
Step 7: Verify Compilation
Build the test binary:
cargo build --bin test_stream_generator
If errors occur, fix:
- Missing imports (add
use ggrs_core::stream::DataCache;) - Variable naming mismatches
- Scope issues with cache variable
Step 8: Report Changes
Provide summary:
- File modified
- Line numbers where patterns were added
- Compilation status
- What to test next
Edge Cases
- If test binary has no pagination, skip cache entirely
- If workflow_id/step_id missing, they're already extracted from environment in test binary
- If cache logic already exists, verify it exactly matches main.rs
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon