Skip to content

Commit 1b91ffb

Browse files
authored
fix: Change the TEMP folder for Gradle tests to home for Windows (#690)
1 parent be29a9f commit 1b91ffb

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/integration/workflows/java_gradle/test_java_gradle.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import shutil
33
import tempfile
4+
import platform
45

56
from unittest import TestCase
67
from pathlib import Path
@@ -36,7 +37,18 @@ class TestJavaGradle(TestCase):
3637

3738
def setUp(self):
3839
self.artifacts_dir = tempfile.mkdtemp()
39-
self.scratch_dir = tempfile.mkdtemp()
40+
41+
scratch_folder_override = None
42+
if platform.system().lower() == "windows" and os.getenv("GITHUB_ACTIONS"):
43+
# lucashuy: there is some really odd behaviour where
44+
# gradle will refuse to work it is run within
45+
# the default TEMP folder location in Github Actions
46+
#
47+
# use the runner's home directory as a workaround
48+
scratch_folder_override = os.getenv("userprofile")
49+
50+
self.scratch_dir = tempfile.mkdtemp(dir=scratch_folder_override)
51+
4052
self.dependencies_dir = tempfile.mkdtemp()
4153
self.builder = LambdaBuilder(language="java", dependency_manager="gradle", application_framework=None)
4254

0 commit comments

Comments
 (0)