From 731957fcd05e116d2f560e77218365924ad71b17 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Tue, 10 Mar 2026 15:48:40 +0100 Subject: [PATCH] fix: tf acc test pipeline --- .github/actions/acc_test/action.yaml | 16 ++++++++-------- internal/testutils/testutils.go | 14 ++++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/actions/acc_test/action.yaml b/.github/actions/acc_test/action.yaml index f3836379..ced5ccd1 100644 --- a/.github/actions/acc_test/action.yaml +++ b/.github/actions/acc_test/action.yaml @@ -130,15 +130,15 @@ runs: shell: bash run: | set -e - if [ ! -f "${{ inputs.service_account_json_file_path }}" ]; then - echo "unable to find service account file '${{ inputs.service_account_json_file_path }}'" - if [ "x${{ inputs.service_account_json_content }}" == "x" ]; then - echo "ERROR: service_account_json_file_content MUST NOT be empty if account file is missing" - exit 1 - fi - echo "creating service account file '${{ inputs.service_account_json_file_path }}'" - echo "${{ inputs.service_account_json_content }}" > stackit/"${{ inputs.service_account_json_file_path }}" + if [ ! -f "${{ inputs.service_account_json_file_path }}" ]; then + echo "unable to find service account file '${{ inputs.service_account_json_file_path }}'" + if [ "x${{ inputs.service_account_json_content }}" == "x" ]; then + echo "ERROR: service_account_json_file_content MUST NOT be empty if account file is missing" + exit 1 fi + echo "creating service account file '${{ inputs.service_account_json_file_path }}'" + echo "${{ inputs.service_account_json_content }}" > stackit/"${{ inputs.service_account_json_file_path }}" + fi ls -l stackit/"${{ inputs.service_account_json_file_path }}" - name: Run acceptance test file diff --git a/internal/testutils/testutils.go b/internal/testutils/testutils.go index 675a9b5b..65c962cc 100644 --- a/internal/testutils/testutils.go +++ b/internal/testutils/testutils.go @@ -6,7 +6,6 @@ import ( "log/slog" "os" "os/exec" - "path/filepath" "strings" "time" @@ -160,11 +159,14 @@ func readTestServiceAccountJsonFromFile(path string) (string, error) { customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE") if !ok || customPath == "" { path = serviceAccountFilePath - home, err := os.UserHomeDir() - if err != nil { - return "", fmt.Errorf("getting home directory: %w", err) - } - path = filepath.Join(home, path) + // TODO: check if we want to handle this with a home dir + /* + home, err := os.UserHomeDir() + if err != nil { + return "", fmt.Errorf("getting home directory: %w", err) + } + path = filepath.Join(home, path) + */ } else { path = customPath }