diff --git a/ci/run-integration-tests.ps1 b/ci/run-integration-tests.ps1 index a16bf161f..45e618633 100644 --- a/ci/run-integration-tests.ps1 +++ b/ci/run-integration-tests.ps1 @@ -30,5 +30,37 @@ if ($env:GITHUB_JOB -eq "Test") { } ./python/run-integration-tests.ps1 -RepoName $RepoName -Packages $packages -Keys $Keys +$status = $LASTEXITCODE -exit $LASTEXITCODE +Write-Host 'Running Selenium tests...' +try { + # Start this repo's cloud example, pointed at the live cloud. + Push-Location "$PSScriptRoot/../fiftyone_devicedetection_examples" + try { + python3 -m venv .venv + $py = $IsWindows ? ".venv/Scripts/python.exe" : ".venv/bin/python" + & $py -m pip install -e . + $env:PORT = 8097 + $env:resource_key = $Keys.TestResourceKey + $env:cloud_endpoint = "https://cloud.51degrees.com/api/v4/" + $example = & $py -m fiftyone_devicedetection_examples.cloud.gettingstarted_web 2>&1 & + } finally { Pop-Location } + + # Get the shared contract tests. + if (-not (Test-Path selenium-api-tests)) { + git clone --depth 1 https://github.com/51Degrees/selenium-api-tests.git + } + # Wait for the example to come up. + curl -sS -o /dev/null --retry 5 --retry-connrefused "http://localhost:$env:PORT" + + $env:CLOUD_ROOT_URL = "https://cloud.51degrees.com/" + $env:PAID_RESOURCE_KEY = $Keys.TestResourceKey + $env:EXAMPLE_URL = "http://localhost:$env:PORT" + $env:EXAMPLE_LANG = 'python' + dotnet test selenium-api-tests -c Release --filter TestCategory=Contract +} catch { + if ($example) { Write-Host '>>> example app output >>>'; Receive-Job $example | Out-Host; Write-Host '<<< app output <<<' } + throw +} finally { + if ($example) { Remove-Job -Force $example } +}