MCPcopy Create free account
hub / github.com/efficientgo/e2e / getTmpDirectory

Function getTmpDirectory

env_docker.go:686–712  ·  view source on GitHub ↗

getTmpDirectory creates a temporary directory for shared integration test files, either in the working directory or a directory referenced by the E2E_TEMP_DIR environment variable.

()

Source from the content-addressed store, hash-verified

684// test files, either in the working directory or a directory referenced by
685// the E2E_TEMP_DIR environment variable.
686func getTmpDirectory() (string, error) {
687 var (
688 dir string
689 err error
690 )
691 // If a temp dir is referenced, return that.
692 if os.Getenv("E2E_TEMP_DIR") != "" {
693 dir = os.Getenv("E2E_TEMP_DIR")
694 } else {
695 dir, err = os.Getwd()
696 if err != nil {
697 return "", err
698 }
699 }
700
701 tmpDir, err := os.MkdirTemp(dir, "e2e_")
702 if err != nil {
703 return "", err
704 }
705 absDir, err := filepath.Abs(tmpDir)
706 if err != nil {
707 _ = os.RemoveAll(tmpDir)
708 return "", err
709 }
710
711 return absDir, nil
712}
713
714func (e *DockerEnvironment) Close() {
715 for _, c := range e.closers {

Callers 1

NewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…