Skip to content

test: CIW fixture git commands inherit the host environment #384

Backlog

Description

@jflowers

The fixture helpers ciGit, ciGitHead, and initClassifyRepo in cmd/gaze/ci_workflow_test.go construct exec.Command values without setting cmd.Env, so every fixture git subprocess inherits the host environment. Exported GIT_DIR/GIT_WORK_TREE redirect fixture operations to the wrong repository, and a global core.hooksPath (machine-wide husky/pre-commit) runs host hooks during fixture commits — the only defended config is the per-command commit.gpgsign=false. The suite passes in CI yet can fail on developer hosts.

Severity: MEDIUM (test isolation — severity pack Tester row: shared state with no observed failure).

Location: cmd/gaze/ci_workflow_test.go:515 (helpers at :489 and :502).

Suggested fix: pass an explicit scrubbed cmd.Env for the fixture git commands — filter GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE and other GIT_* variables, and neutralize global config such as core.hooksPath — restoring hermeticity.

Source: review feedback on PR #373 — #373 (comment) (divisor-testing, council review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions