Redact invalid chunk plan lookup diagnostics
This commit is contained in:
@@ -255,6 +255,22 @@ func TestRunRecordsExplicitChunkCacheOverrideAndEffectiveMode(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunChunkPlanDiagnosticsRedactStoreDecisionReason(t *testing.T) {
|
||||
diagnosticsDir := t.TempDir()
|
||||
configPath := writeTestConfig(t, cacheTestConfig("auto", t.TempDir(), diagnosticsDir))
|
||||
factory := &recordingChunkPlanFactory{store: &recordingChunkPlanStore{
|
||||
decision: pipeline.ChunkPlanDecision{Status: pipeline.ChunkPlanInvalid, Reason: "SENTINEL_INVALID_RECORD_CONTENT"},
|
||||
}}
|
||||
code, stderr := runCacheCommand(t, cacheRunArgs(t, configPath), cacheTestOptions(t, nil, factory))
|
||||
if code != 0 || stderr != "" {
|
||||
t.Fatalf("code=%d stderr=%q", code, stderr)
|
||||
}
|
||||
summary := string(readFile(t, filepath.Join(onlyChildDir(t, diagnosticsDir), diagnostics.ArtifactChunkPlan)))
|
||||
if strings.Contains(summary, "SENTINEL_INVALID_RECORD_CONTENT") || !strings.Contains(summary, `"lookup_reason": "stored chunk plan is invalid"`) {
|
||||
t.Fatalf("chunk plan diagnostic = %s", summary)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultAutoReusesPlanAcrossIndependentInvocations(t *testing.T) {
|
||||
cacheBase := filepath.Join(t.TempDir(), "cache")
|
||||
workspaceDir := filepath.Join(t.TempDir(), "workspace")
|
||||
|
||||
Reference in New Issue
Block a user