Skip to content

Commit 57b05af

Browse files
[no-relnote] Make E2E tests runnable from darwin
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent b2948bc commit 57b05af

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/e2e/nvidia-container-toolkit_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ package e2e
1919
import (
2020
"context"
2121
"fmt"
22+
"path"
2223
"path/filepath"
24+
"runtime"
2325
"strings"
2426

27+
"github.com/google/uuid"
2528
. "github.com/onsi/ginkgo/v2"
2629
. "github.com/onsi/gomega"
2730
)
@@ -340,7 +343,15 @@ var _ = Describe("docker", Ordered, ContinueOnFailure, func() {
340343
_, _, err := runner.Run("docker pull ubuntu")
341344
Expect(err).ToNot(HaveOccurred())
342345

343-
tmpDirPath = GinkgoT().TempDir()
346+
var tmpDirPath string
347+
// Make test runable from a MacOs hosts.
348+
// On darwin, the temp dir is in /var/folders/.../T/
349+
// We need to convert it to /tmp/...
350+
if runtime.GOOS == "darwin" {
351+
tmpDirPath = path.Join("/tmp", uuid.NewString())
352+
} else {
353+
tmpDirPath = GinkgoT().TempDir()
354+
}
344355
_, _, err = runner.Run("mkdir -p " + tmpDirPath)
345356
Expect(err).ToNot(HaveOccurred())
346357

0 commit comments

Comments
 (0)