Documentation
¶
Overview ¶
Package testgit is the one identity a test's git commit runs under. A hosted runner (ubuntu-latest) carries no global git identity, and the self-hosted benches do, so a test that commits in a scratch repository and leans on the machine's config is green on every bench and red on the hosted leg with `Author identity unknown` (run 37344601638). Every test that runs `git commit` takes its author and committer from here, through the command's environment, never t.Setenv and never the runner's config; the class test TestNoTestCommitsWithoutTheSharedGitIdentity (internal/ci/git_identity_class_test.go) refuses a commit that does not.
Index ¶
Constants ¶
const ( Name = "nova-test" Email = "nova-test@example.invalid" )
Name and Email are the fixed author and committer of every test commit.
Variables ¶
This section is empty.
Functions ¶
func Env ¶
func Env() []string
Env is the author and committer identity as environment variables, for a command whose Env the caller builds itself.
func Environ ¶
Environ is the caller's environment, then Env, then extra: a later variable wins in os/exec, so the identity overrides any the runner's environment carries and extra overrides both.
func NoGlobalConfig ¶
NoGlobalConfig is the hosted runner's git on any machine: the system config off and the global config at a file under t.TempDir() that sets only user.useConfigOnly, so git never guesses an identity from the host name. A command run with it and without Env refuses to commit on a bench exactly as it does on ubuntu-latest.
Types ¶
This section is empty.