16 lines
1.1 KiB
PowerShell
16 lines
1.1 KiB
PowerShell
[CmdletBinding()]
|
|||
|
|
param(
|
||
|
|
[Parameter(Mandatory=$true)][string]$CalendarEventId,
|
||
|
|
[Parameter(Mandatory=$true)][string]$MeetingId,
|
||
|
|
[Parameter(Mandatory=$true)][string]$MessageId
|
||
|
|
)
|
||
|
|
$ErrorActionPreference = "Stop"
|
||
|
|
foreach ($name in @('SCHEDULING_TEST_DATABASE')) { if ([string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($name))) { throw "Required isolated test configuration is missing: $name" } }
|
||
|
|
$projectRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||
|
|
$pythonCommand = Get-Command python -ErrorAction SilentlyContinue
|
||
|
|
if (-not $pythonCommand) { throw "Python 3.11 or newer must be available on PATH." }
|
||
|
|
$env:PYTHONPATH = Join-Path $projectRoot "src"
|
||
|
|
$env:SCHEDULING_TEST_CALENDAR_EVENT_ID = $CalendarEventId
|
||
|
|
$env:SCHEDULING_TEST_MEETING_ID = $MeetingId
|
||
|
|
$env:SCHEDULING_TEST_MESSAGE_ID = $MessageId
|
||
|
|
try { & $pythonCommand.Source (Join-Path $PSScriptRoot "record_supervised_calendar_invite_delivery.py"); exit $LASTEXITCODE } finally { Remove-Item Env:\PYTHONPATH,Env:\SCHEDULING_TEST_CALENDAR_EVENT_ID,Env:\SCHEDULING_TEST_MEETING_ID,Env:\SCHEDULING_TEST_MESSAGE_ID -ErrorAction SilentlyContinue }
|