From a33c86cbc9720132ecaf664633c23029d80e1c81 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Mon, 23 Nov 2026 01:56:12 +0000 Subject: [PATCH 1/2] BUILD: Give the browser contract suite its _51DEGREES_ names The selenium-api-tests suite now reads only the _51DEGREES_ names. The browser contract run still set EXAMPLE_URL and EXAMPLE_LANG, so the suite saw no running example, tried to launch a .NET example of its own, and failed every Contract test asking for _51DEGREES_RESOURCE_KEY_BESPOKE. Set _51DEGREES_EXAMPLE_URL and _51DEGREES_EXAMPLE_LANG instead. An example that is already running needs no key from the suite. CLOUD_ROOT_URL and PAID_RESOURCE_KEY are no longer set, because the suite no longer reads them. --- ci/run-integration-tests.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/run-integration-tests.ps1 b/ci/run-integration-tests.ps1 index 2df9e505f..44a546d9a 100644 --- a/ci/run-integration-tests.ps1 +++ b/ci/run-integration-tests.ps1 @@ -100,8 +100,11 @@ function Invoke-ContractTests { curl -sS -o $(if ($IsWindows) { 'NUL' } else { '/dev/null' }) --retry 20 --retry-delay 3 --retry-max-time 120 --retry-connrefused "http://localhost:$Port" if ($LASTEXITCODE -ne 0) { throw "The $Label web example did not start on port $Port." } - $env:EXAMPLE_URL = "http://localhost:$Port" - $env:EXAMPLE_LANG = 'java' + # The suite reads the running example's address and language under + # its _51DEGREES_ names. Without _51DEGREES_EXAMPLE_URL it launches + # an example of its own. + ${env:_51DEGREES_EXAMPLE_URL} = "http://localhost:$Port" + ${env:_51DEGREES_EXAMPLE_LANG} = 'java' # Normal verbosity prints each test's time, passed or failed. dotnet test selenium-api-tests -c Release --filter TestCategory=Contract --logger "console;verbosity=normal" # PowerShell does not stop for a native command that returns non-zero, @@ -115,7 +118,8 @@ function Invoke-ContractTests { throw } finally { if ($example) { Remove-Job -Force $example } - Remove-Item env:PORT, env:EXAMPLE_URL -ErrorAction SilentlyContinue + Remove-Item env:PORT, env:_51DEGREES_EXAMPLE_URL, env:_51DEGREES_EXAMPLE_LANG ` + -ErrorAction SilentlyContinue foreach ($name in $ExampleEnv.Keys) { Remove-Item "env:$name" -ErrorAction SilentlyContinue } @@ -137,10 +141,6 @@ if (-not $SeleniumContract) { Write-Host "Cloning the Selenium contract tests from '$seleniumRef'" git clone --depth 1 --branch $seleniumRef https://github.com/51Degrees/selenium-api-tests.git } - $env:CLOUD_ROOT_URL = "https://cloud.51degrees.com/" - # The shared suite reads its key under this name of its own. - $env:PAID_RESOURCE_KEY = $env:_51DEGREES_RESOURCE_KEY - # Chrome's first start on a fresh runner is many times slower than the # starts after it, so it is made here rather than inside the first test. # The tests still run when it cannot be made. From 4d29621c5771004e7f175426a85e00c86bf64ada Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Mon, 23 Nov 2026 02:16:42 +0000 Subject: [PATCH 2/2] BUILD: Give the browser contract's cloud example the bespoke key The Selenium contract ran only when _51DEGREES_RESOURCE_KEY was set. CI has no secret or variable of that name, and common-ci exports each _51DEGREES_ name as it is, so the contract was skipped in CI. The run now asks for _51DEGREES_RESOURCE_KEY_BESPOKE, the key that carries every property, and gives it to the cloud example under the name it reads, _51DEGREES_RESOURCE_KEY, for that run only. --- ci/run-integration-tests.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ci/run-integration-tests.ps1 b/ci/run-integration-tests.ps1 index 44a546d9a..3a160f76c 100644 --- a/ci/run-integration-tests.ps1 +++ b/ci/run-integration-tests.ps1 @@ -129,8 +129,8 @@ function Invoke-ContractTests { Write-Host "::group::Selenium contract tests" if (-not $SeleniumContract) { Write-Host "Another entry runs the Selenium contract tests for this pull request." -} elseif (-not $env:_51DEGREES_RESOURCE_KEY) { - Write-Host "::warning title=Selenium skipped::_51DEGREES_RESOURCE_KEY is not set, so the Selenium contract tests were not run against the web examples." +} elseif (-not $env:_51DEGREES_RESOURCE_KEY_BESPOKE) { + Write-Host "::warning title=Selenium skipped::_51DEGREES_RESOURCE_KEY_BESPOKE is not set, so the Selenium contract tests were not run against the web examples." } elseif ($IsLinux -and [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq [System.Runtime.InteropServices.Architecture]::Arm64) { Write-Host "::warning title=Selenium skipped::Selenium contract skipped on linux-arm64, which has no selenium-manager build. It runs on x64 and macOS arm64." } else { @@ -154,9 +154,14 @@ if (-not $SeleniumContract) { @{ Label = 'cloud' Module = 'web/getting-started.cloud' - # The example reads _51DEGREES_RESOURCE_KEY, and the production - # cloud unless _51DEGREES_CLOUD_ENDPOINT names another. + # The example reads its key as _51DEGREES_RESOURCE_KEY, and the + # production cloud unless _51DEGREES_CLOUD_ENDPOINT names another. + # The contract needs every property, so it is given the key that + # carries them all. Port = 8099 + ExampleEnv = @{ + '_51DEGREES_RESOURCE_KEY' = $env:_51DEGREES_RESOURCE_KEY_BESPOKE + } } # The on-premise example, against the TAC data file that # fetch-assets.ps1 links into the data repository. The Lite data file