Skip to content

Commit

Permalink
fix: Change the TEMP folder for Gradle tests to home for Windows (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashuy authored Oct 10, 2024
1 parent be29a9f commit 1b91ffb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/integration/workflows/java_gradle/test_java_gradle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import shutil
import tempfile
import platform

from unittest import TestCase
from pathlib import Path
Expand Down Expand Up @@ -36,7 +37,18 @@ class TestJavaGradle(TestCase):

def setUp(self):
self.artifacts_dir = tempfile.mkdtemp()
self.scratch_dir = tempfile.mkdtemp()

scratch_folder_override = None
if platform.system().lower() == "windows" and os.getenv("GITHUB_ACTIONS"):
# lucashuy: there is some really odd behaviour where
# gradle will refuse to work it is run within
# the default TEMP folder location in Github Actions
#
# use the runner's home directory as a workaround
scratch_folder_override = os.getenv("userprofile")

self.scratch_dir = tempfile.mkdtemp(dir=scratch_folder_override)

self.dependencies_dir = tempfile.mkdtemp()
self.builder = LambdaBuilder(language="java", dependency_manager="gradle", application_framework=None)

Expand Down

0 comments on commit 1b91ffb

Please sign in to comment.