summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-07-14 12:22:47 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2018-07-26 14:07:00 +0100
commite2cc5b6d9739591703cfb7f04efa84425ed63332 (patch)
tree0c7bbd1391541a4d4db5eb82502861e42d8e6b63
parent3b6281fac165bd910abe7e961e5e65168723a187 (diff)
downloadlibgit2-e2cc5b6d9739591703cfb7f04efa84425ed63332.tar.gz
ci: move tests into citest.ps1
Add citest.ps1 PowerShell script to run the tests.
-rw-r--r--ci/build.ps119
-rw-r--r--ci/test.ps145
2 files changed, 45 insertions, 19 deletions
diff --git a/ci/build.ps1 b/ci/build.ps1
index 12cc4fb54..c5c7c870a 100644
--- a/ci/build.ps1
+++ b/ci/build.ps1
@@ -29,22 +29,3 @@ Write-Host "####################################################################
cmake --build .
if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
-
-if ($Env:SKIP_TESTS) { exit }
-
-Write-Host ""
-Write-Host "#######################################################################"
-Write-Host "## Running (offline) tests"
-Write-Host "#######################################################################"
-
-ctest -V -R offline
-if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
-
-Write-Host ""
-Write-Host "#######################################################################"
-Write-Host "## Running (online) tests"
-Write-Host "#######################################################################"
-
-ctest -V -R online
-if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
-
diff --git a/ci/test.ps1 b/ci/test.ps1
new file mode 100644
index 000000000..843df7034
--- /dev/null
+++ b/ci/test.ps1
@@ -0,0 +1,45 @@
+Set-StrictMode -Version Latest
+
+$ErrorActionPreference = "Stop"
+$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
+
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+
+if ($Env:SKIP_TESTS) { exit }
+
+Write-Host "##############################################################################"
+Write-Host "## Configuring test environment"
+Write-Host "##############################################################################"
+
+Write-Host ""
+Write-Host "Starting HTTP proxy..."
+Invoke-WebRequest -Method GET -Uri https://github.com/ethomson/poxyproxy/releases/download/v0.1.0/poxyproxy-0.1.0.jar -OutFile poxyproxy.jar
+javaw -jar poxyproxy.jar -d --port 8080 --credentials foo:bar
+
+Write-Host ""
+Write-Host "##############################################################################"
+Write-Host "## Running (offline) tests"
+Write-Host "##############################################################################"
+
+ctest -V -R offline
+if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
+
+Write-Host ""
+Write-Host "##############################################################################"
+Write-Host "## Running (online) tests"
+Write-Host "##############################################################################"
+
+ctest -V -R online
+if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
+
+Write-Host ""
+Write-Host "Running proxy tests"
+Write-Host ""
+
+$Env:GITTEST_REMOTE_PROXY_URL="localhost:8080"
+$Env:GITTEST_REMOTE_PROXY_USER="foo"
+$Env:GITTEST_REMOTE_PROXY_PASS="bar"
+ctest -V -R proxy
+if ($LastExitCode -ne 0) { [Environment]::Exit($LastExitCode) }
+
+taskkill /F /IM javaw.exe