Documentation
¶
Overview ¶
Package evidence writes local integration/e2e evidence for Pinax test runs.
证据目录结构由 integration evidence runner 写入,供 QA、review 和 closeout 使用。本包把核心写入逻辑从 main 中抽离,让测试可以直接验证:
- 成功和失败都会生成完整证据目录;
- 失败时保留原始退出码,不吞 stderr;
- 证据文件不含 token、Authorization header、raw provider payload、绝对路径 等敏感串——所有写入 stdout/stderr/command/env 的内容都经过 Redact 处理。
Index ¶
Constants ¶
View Source
const EnvSchemaVersion = "yeisme.integration_test_env.v1"
EnvSchemaVersion 是 env.json 的稳定 schema 版本。
View Source
const Layer = "integration-evidence"
Layer 标识证据来源的测试层。
View Source
const Project = "cli/pinax"
Project 标识证据归属的子项目。
View Source
const SchemaVersion = "yeisme.integration_test_evidence.v1"
SchemaVersion 是 evidence summary 的稳定 schema 版本。
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// RunID 是本次运行的唯一标识,用作证据子目录名。
RunID string
// ParentDir 是存放运行子目录的父目录,例如 temp/integration-test-runs。
ParentDir string
// Command 是要执行并采集证据的命令。
Command []string
// PassThroughStdout/Stderr 不为 nil 时,命令原始(未脱敏)输出同时写到
// 对应 writer;证据文件始终写入脱敏后的版本。
PassThroughStdout io.Writer
PassThroughStderr io.Writer
// ExtraChecks 是写入 summary.json checks 字段的额外键。
ExtraChecks map[string]any
// PassStatus lets a newer evidence profile use the standard "passed"
// spelling without changing existing Pinax profiles that historically emit
// "success".
PassStatus string
// Layer overrides the legacy default for component/system canaries.
Layer string
}
Config 控制 Run 的行为。
type Redaction ¶
type Redaction struct {
Applied bool `json:"applied"`
SchemaVersion string `json:"schema_version"`
ScannedSurfaces []string `json:"scanned_surfaces"`
ForbiddenClasses []string `json:"forbidden_classes"`
PathRedacted bool `json:"path_redacted"`
}
Redaction 描述本次证据写入应用的脱敏策略,写入 summary.redaction。
Click to show internal directories.
Click to hide internal directories.