From 41d410caf446b136224dc48d884f4cf5e84e59de Mon Sep 17 00:00:00 2001 From: maze Date: Tue, 9 Sep 2025 15:21:19 +0200 Subject: [PATCH] Use proper paths for tests --- .gitea/workflows/test.yaml | 60 ++------------------------------------ 1 file changed, 3 insertions(+), 57 deletions(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index b4286ec..177e5c0 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -51,7 +51,7 @@ jobs: VAULT_ADDR: "https://127.0.0.1:8200" VAULT_SKIP_VERIFY: "true" run: | - & ".\scripts\vault-start.ps1" + .\script\vault-start.ps1 - name: Setup Vault test data (on Unix) if: matrix.arch != 'windows-amd64' @@ -72,7 +72,7 @@ jobs: VAULT_SKIP_VERIFY: "true" shell: pwsh run: | - & ".\scripts\vault-setup.ps1" + .\script\vault-setup.ps1 - name: Vet run: go vet -v ./... @@ -99,58 +99,4 @@ jobs: if: always() && matrix.arch == 'windows-amd64' shell: pwsh run: | - # Function to display logs - function Show-VaultLogs { - Write-Output "=== VAULT SERVER STDOUT (last 50 lines) ===" - Get-Content "vault-logs/stdout.log" -ErrorAction SilentlyContinue | Select-Object -Last 50 - Write-Output "=== VAULT SERVER STDERR (last 50 lines) ===" - Get-Content "vault-logs/stderr.log" -ErrorAction SilentlyContinue | Select-Object -Last 50 - } - - # Read PID from file (Gitea alternative to env vars) - $vaultPid = $null - if (Test-Path "vault-pid.txt") { - $vaultPid = Get-Content "vault-pid.txt" -Raw - Write-Output "Found Vault PID: $vaultPid" - } - - # Check if previous steps failed - $previousStepFailed = $false - if ("${{ steps.start-vault.outcome }}" -eq "failure") { - $previousStepFailed = $true - Write-Output "Vault startup step failed" - } - - # Stop the Vault process if we have a PID - if ($vaultPid -and ($vaultPid -ne '')) { - if ($previousStepFailed) { - Write-Output "Previous step failed, showing Vault logs:" - Show-VaultLogs - } - - # Stop the Vault process - try { - Stop-Process -Id $vaultPid -Force -ErrorAction Stop - Write-Output "Stopped Vault process $vaultPid" - } catch { - Write-Warning "Failed to stop process $vaultPid: $($_.Exception.Message)" - } - } - - # Clean up any remaining Vault processes - $vaultProcesses = Get-Process -Name "vault" -ErrorAction SilentlyContinue - if ($vaultProcesses) { - Write-Output "Found additional Vault processes, stopping them..." - $vaultProcesses | Stop-Process -Force -ErrorAction SilentlyContinue - } - - # Always show logs if we're in a failure state - if ($previousStepFailed -or "${{ job.status }}" -eq "failure") { - Write-Output "Job failed, showing final Vault logs:" - Show-VaultLogs - } - - # Cleanup PID file - if (Test-Path "vault-pid.txt") { - Remove-Item "vault-pid.txt" -Force - } \ No newline at end of file + .\script\vault-stop.ps1 \ No newline at end of file