2023-12-14 18:03:19 +00:00
|
|
|
Set-StrictMode -Version Latest
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$ProgressPreference = "SilentlyContinue"
|
|
|
|
|
|
|
|
$WorkingDirectory = Get-Location
|
|
|
|
$CloudflaredDirectory = "$WorkingDirectory\go\src\github.com\cloudflare\cloudflared"
|
|
|
|
|
|
|
|
go env
|
|
|
|
go version
|
|
|
|
|
|
|
|
$env:TARGET_OS = "windows"
|
|
|
|
$env:CGO_ENABLED = 1
|
|
|
|
$env:TARGET_ARCH = "amd64"
|
|
|
|
$env:Path = "$Env:Temp\go\bin;$($env:Path)"
|
|
|
|
|
2024-07-02 11:45:17 +00:00
|
|
|
python --version
|
|
|
|
python -m pip --version
|
2023-12-14 18:03:19 +00:00
|
|
|
|
|
|
|
cd $CloudflaredDirectory
|
|
|
|
|
|
|
|
go env
|
|
|
|
go version
|
|
|
|
|
|
|
|
Write-Output "Building cloudflared"
|
|
|
|
|
|
|
|
& make cloudflared
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "Failed to build cloudflared" }
|
|
|
|
|
|
|
|
echo $LASTEXITCODE
|
|
|
|
|
|
|
|
Write-Output "Running unit tests"
|
|
|
|
|
|
|
|
# Not testing with race detector because of https://github.com/golang/go/issues/61058
|
|
|
|
# We already test it on other platforms
|
|
|
|
& go test -failfast -mod=vendor ./...
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw "Failed unit tests" }
|
|
|
|
|
|
|
|
Write-Output "Running component tests"
|
|
|
|
|
2024-07-02 11:45:17 +00:00
|
|
|
python -m pip --disable-pip-version-check install --upgrade -r component-tests/requirements.txt
|
|
|
|
python component-tests/setup.py --type create
|
|
|
|
python -m pytest component-tests -o log_cli=true --log-cli-level=INFO
|
2023-12-14 18:03:19 +00:00
|
|
|
if ($LASTEXITCODE -ne 0) {
|
2024-07-02 11:45:17 +00:00
|
|
|
python component-tests/setup.py --type cleanup
|
2023-12-14 18:03:19 +00:00
|
|
|
throw "Failed component tests"
|
|
|
|
}
|
2024-07-02 11:45:17 +00:00
|
|
|
python component-tests/setup.py --type cleanup
|