{"modulePath":"github.com/uber/submitqueue","version":"v0.3.0-20261125210437-add1a4bd2ea2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitexectest\n\nPackage gitexectest resolves the Bazel-pinned git a test target supplies.\n\nTests that shell out to git run against the same pinned build the services use, rather than whatever the host happens to have, so a developer's git version cannot change what a test proves. A target opts in by depending on the binary and naming it in the environment:\n\n\tgo_test(\n\t    data = [\"@git\"],\n\t    env = {\"SUBMITQUEUE_TEST_GIT\": \"$(location @git//:git)\"},\n\t)\n\nThe indirection through an environment variable is Bazel's: rules\\_go expands $(location) to an execroot-relative path, which for an external output has to be re-rooted under the runfiles tree the test actually runs from.\n\n## Constants\n\n```go\nconst GitEnv = \"SUBMITQUEUE_TEST_GIT\"\n```\nGitEnv is the variable a test target sets to the pinned git binary.\n\n## Functions\n\n```go\nfunc Git(t *testing.T) string\n```\nGit returns an absolute path to the pinned git binary, failing the test if the target did not supply one.\n\n```go\nfunc Runfile(t *testing.T, name string) string\n```\nRunfile resolves the $(location)-expanded path held by the named environment variable, failing the test if it is unset or does not resolve.\n\nA path that is already usable is returned as-is, which is what happens under \\`bazel run\\`, where the process already starts inside the runfiles tree.\n\n","path":"github.com/uber/submitqueue/platform/git/exectest","name":"gitexectest","synopsis":"Package gitexectest resolves the Bazel-pinned git a test target supplies.","isRedistributable":true}
