ci: screenshot diff, installer test and every PostgreSQL authentication method
- Screenshots: a capture that exits with an error or writes nothing fails the job (the pictures it wrote are still published); the new "Screenshot diff" step compares them with tests/visual/baselines, fails beyond the tolerance, warns once for screens without a baseline and uploads the diff images. - installer (windows-latest): publishes App, Uploader and Setup (self-contained single file, no ReadyToRun), packs Titano 1.0.0 (with an extra legacy.txt), Titano 1.0.1 and the Uploader installer, and runs .github/scripts/installer-test.ps1: argument and not-installed exit codes, silent install into a folder with a space, Add/Remove Programs, shortcuts and the .titano file type, the installed programs drawing their screens, upgrade in place removing legacy.txt, uninstall removing itself, user data kept, the Uploader installer; the setup logs are printed whatever happens. The script now resolves its paths from the PowerShell location. - PostgreSQL 16/17: postgres-ci-setup.sh prepares the service container and the job exports the MD5, cleartext, trust, TLS and root-certificate variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+233
-9
No files matched your search
@@ -0,0 +1,117 @@
|
||||
# Installs, runs, upgrades and removes the packed installers on a clean Windows runner (BRIEF §18): silent mode,
|
||||
# folder with a space, Add/Remove Programs entry, shortcuts, the .titano file type, upgrade in place (files of the
|
||||
# previous version removed), user data kept, the uninstaller removing itself, and the documented exit codes.
|
||||
param(
|
||||
[Parameter(Mandatory)] [string] $Setup1,
|
||||
[Parameter(Mandatory)] [string] $Setup2,
|
||||
[Parameter(Mandatory)] [string] $UploaderSetup,
|
||||
[Parameter(Mandatory)] [string] $Version1,
|
||||
[Parameter(Mandatory)] [string] $Version2,
|
||||
[Parameter(Mandatory)] [string] $Screenshots
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
# Relative paths are taken from the PowerShell location: .NET resolves them from the process directory, which a
|
||||
# Set-Location does not move, and the programs get the screenshot folder as an argument.
|
||||
$Setup1 = (Resolve-Path -LiteralPath $Setup1).Path
|
||||
$Setup2 = (Resolve-Path -LiteralPath $Setup2).Path
|
||||
$UploaderSetup = (Resolve-Path -LiteralPath $UploaderSetup).Path
|
||||
$Screenshots = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Screenshots)
|
||||
|
||||
function Invoke-Program([string] $Exe, [string[]] $Arguments) {
|
||||
$start = [System.Diagnostics.ProcessStartInfo]::new($Exe)
|
||||
foreach ($argument in $Arguments) { $start.ArgumentList.Add($argument) }
|
||||
$start.UseShellExecute = $false
|
||||
$process = [System.Diagnostics.Process]::Start($start)
|
||||
if (-not $process.WaitForExit(600000)) {
|
||||
$process.Kill($true)
|
||||
throw "$Exe $Arguments did not finish in 10 minutes"
|
||||
}
|
||||
Write-Host "$(Split-Path $Exe -Leaf) $Arguments -> exit $($process.ExitCode)"
|
||||
return $process.ExitCode
|
||||
}
|
||||
|
||||
function Assert-True([bool] $Condition, [string] $Message) {
|
||||
if (-not $Condition) { throw "FAILED: $Message" }
|
||||
Write-Host "ok: $Message"
|
||||
}
|
||||
|
||||
function Wait-Removed([string] $Path) {
|
||||
for ($i = 0; $i -lt 120 -and (Test-Path -LiteralPath $Path); $i++) { Start-Sleep -Milliseconds 500 }
|
||||
return -not (Test-Path -LiteralPath $Path)
|
||||
}
|
||||
|
||||
function Get-DefaultValue([string] $Key) {
|
||||
if (-not (Test-Path -LiteralPath $Key)) { return $null }
|
||||
return (Get-Item -LiteralPath $Key).GetValue('')
|
||||
}
|
||||
|
||||
$dir = Join-Path $env:RUNNER_TEMP 'Titano Test'
|
||||
$entryKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Titano'
|
||||
$programs = [Environment]::GetFolderPath('Programs')
|
||||
$desktop = [Environment]::GetFolderPath('DesktopDirectory')
|
||||
$links = @(
|
||||
(Join-Path $programs 'Titano.lnk'), (Join-Path $programs 'Titano Uploader.lnk'),
|
||||
(Join-Path $desktop 'Titano.lnk'), (Join-Path $desktop 'Titano Uploader.lnk'))
|
||||
$userData = Join-Path $env:LOCALAPPDATA 'Titano'
|
||||
$userFile = Join-Path $userData 'kept-by-setup.txt'
|
||||
New-Item -ItemType Directory -Force -Path $userData | Out-Null
|
||||
Set-Content -LiteralPath $userFile -Value 'user data'
|
||||
|
||||
Write-Host '--- Arguments'
|
||||
Assert-True ((Invoke-Program $Setup1 @('/BOGUS')) -eq 2) 'an unknown switch exits with 2 (invalid arguments)'
|
||||
Assert-True ((Invoke-Program $Setup1 @('/S', '/uninstall')) -eq 6) 'removing a product that is not installed exits with 6'
|
||||
|
||||
Write-Host "--- Install $Version1 into '$dir'"
|
||||
Assert-True ((Invoke-Program $Setup1 @('/S', "/DIR=$dir")) -eq 0) 'silent install exits with 0'
|
||||
foreach ($file in 'Titano.exe', 'Titano.Uploader.exe', 'Uninstall Titano.exe', 'install-log.json', 'legacy.txt') {
|
||||
Assert-True (Test-Path -LiteralPath (Join-Path $dir $file)) "$file installed"
|
||||
}
|
||||
$entry = Get-ItemProperty -LiteralPath $entryKey
|
||||
Assert-True ($entry.DisplayVersion -eq $Version1) "Add/Remove Programs lists version $Version1"
|
||||
Assert-True ($entry.InstallLocation -eq $dir) 'Add/Remove Programs lists the chosen folder'
|
||||
Assert-True ($entry.QuietUninstallString -eq "`"$(Join-Path $dir 'Uninstall Titano.exe')`" /uninstall /S") 'quiet uninstall command points at the uninstaller'
|
||||
foreach ($link in $links) { Assert-True (Test-Path -LiteralPath $link) "shortcut '$link' created" }
|
||||
Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\.titano') -eq 'Titano.Project') '.titano opens with Titano'
|
||||
Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\Titano.Project\shell\open\command') -eq "`"$(Join-Path $dir 'Titano.exe')`" `"%1`"") 'Titano.Project opens the installed Titano.exe'
|
||||
|
||||
Write-Host '--- Run the installed programs'
|
||||
foreach ($program in 'Titano.exe', 'Titano.Uploader.exe') {
|
||||
$before = @(Get-ChildItem -Path $Screenshots -Filter *.png -ErrorAction SilentlyContinue).Count
|
||||
$code = Invoke-Program (Join-Path $dir $program) @('--capture', $Screenshots)
|
||||
$count = @(Get-ChildItem -Path $Screenshots -Filter *.png -ErrorAction SilentlyContinue).Count - $before
|
||||
Assert-True ($code -eq 0 -and $count -gt 0) "installed $program starts and draws its screens ($count screenshot(s))"
|
||||
}
|
||||
|
||||
Write-Host "--- Upgrade in place to $Version2"
|
||||
Assert-True ((Invoke-Program $Setup2 @('/S')) -eq 0) 'silent upgrade exits with 0'
|
||||
Assert-True ((Get-ItemProperty -LiteralPath $entryKey).DisplayVersion -eq $Version2) "Add/Remove Programs lists version $Version2"
|
||||
Assert-True ((Get-Content -Raw -LiteralPath (Join-Path $dir 'install-log.json') | ConvertFrom-Json).version -eq $Version2) "install log records version $Version2"
|
||||
Assert-True (Test-Path -LiteralPath (Join-Path $dir 'Titano.exe')) 'Titano.exe still installed'
|
||||
Assert-True (-not (Test-Path -LiteralPath (Join-Path $dir 'legacy.txt'))) 'a file only the previous version had is removed'
|
||||
foreach ($link in $links) { Assert-True (Test-Path -LiteralPath $link) "shortcut '$link' kept" }
|
||||
Assert-True (Test-Path -LiteralPath $userFile) 'user data kept by the upgrade'
|
||||
|
||||
Write-Host '--- Uninstall with the installed uninstaller'
|
||||
Assert-True ((Invoke-Program (Join-Path $dir 'Uninstall Titano.exe') @('/uninstall', '/S')) -eq 0) 'silent uninstall exits with 0'
|
||||
Assert-True (Wait-Removed $dir) 'install folder removed, uninstaller included'
|
||||
Assert-True (-not (Test-Path -LiteralPath $entryKey)) 'Add/Remove Programs entry removed'
|
||||
foreach ($link in $links) { Assert-True (-not (Test-Path -LiteralPath $link)) "shortcut '$link' removed" }
|
||||
Assert-True (-not (Test-Path -LiteralPath 'HKCU:\Software\Classes\Titano.Project')) 'Titano.Project file type removed'
|
||||
Assert-True ($null -eq (Get-DefaultValue 'HKCU:\Software\Classes\.titano')) '.titano no longer opens with Titano'
|
||||
Assert-True (Test-Path -LiteralPath $userFile) 'user data kept by the uninstall'
|
||||
|
||||
Write-Host '--- Uploader installer: default folder, removal through the installer itself'
|
||||
$uploaderDir = Join-Path $env:LOCALAPPDATA 'Programs\Titano Uploader'
|
||||
$uploaderKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\TitanoUploader'
|
||||
Assert-True ((Invoke-Program $UploaderSetup @('/S')) -eq 0) 'silent Uploader install exits with 0'
|
||||
Assert-True (Test-Path -LiteralPath (Join-Path $uploaderDir 'Titano.Uploader.exe')) 'Uploader installed in %LOCALAPPDATA%\Programs\Titano Uploader'
|
||||
Assert-True (Test-Path -LiteralPath $uploaderKey) 'Uploader listed in Add/Remove Programs'
|
||||
Assert-True ((Invoke-Program $UploaderSetup @('/uninstall', '/S')) -eq 0) 'silent Uploader removal exits with 0'
|
||||
Assert-True (Wait-Removed $uploaderDir) 'Uploader folder removed'
|
||||
Assert-True (-not (Test-Path -LiteralPath $uploaderKey)) 'Uploader entry removed'
|
||||
Assert-True (Test-Path -LiteralPath $userFile) 'user data kept'
|
||||
|
||||
Write-Host 'Installer test passed.'
|
||||
@@ -99,6 +99,7 @@ jobs:
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set +e
|
||||
failed=0
|
||||
for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe \
|
||||
src/Titano.Setup/bin/Release/net10.0-windows/Titano.Setup.exe; do
|
||||
name=$(basename "$exe" .exe)
|
||||
@@ -109,8 +110,28 @@ jobs:
|
||||
cat "out/capture-$name.log"
|
||||
count=$(( $(ls out/screenshots/*.png 2>/dev/null | wc -l) - before ))
|
||||
echo "$name capture exit code $code, $count screenshot(s)"
|
||||
if [ "$count" -eq 0 ]; then echo "::warning title=Screenshots::$name --capture produced no images (exit $code)"; fi
|
||||
# A capture that crashed or wrote nothing fails the job; the pictures it did write are still published.
|
||||
if [ "$code" -ne 0 ] || [ "$count" -eq 0 ]; then
|
||||
echo "::error title=Screenshots::$name --capture failed (exit $code, $count screenshot(s))"
|
||||
failed=1
|
||||
fi
|
||||
done
|
||||
exit $failed
|
||||
|
||||
# BRIEF §20.2 visual regression against tests/visual/baselines: a screen beyond the tolerance fails, one without
|
||||
# a baseline only warns (the baselines README says how to add them).
|
||||
- name: Screenshot diff
|
||||
if: runner.os == 'Windows' && !cancelled() && hashFiles('out/screenshots/*.png') != ''
|
||||
run: dotnet "$TOOLS" screenshots diff out/screenshots --baseline tests/visual/baselines --out out/screenshot-diff
|
||||
|
||||
- name: Upload screenshot diffs
|
||||
if: runner.os == 'Windows' && !cancelled() && hashFiles('out/screenshot-diff/*.png') != ''
|
||||
continue-on-error: true
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: screenshot-diff
|
||||
path: out/screenshot-diff/
|
||||
retention-days: 7
|
||||
|
||||
# Handed to the screenshots job through the cache: it does not count against the artifact storage quota.
|
||||
- name: Keep screenshots for the screenshots job
|
||||
@@ -180,6 +201,69 @@ jobs:
|
||||
git commit -q -m "Screenshots of ${{ github.event.pull_request.head.sha }}"
|
||||
git push -q -f "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:refs/heads/ci-screenshots
|
||||
|
||||
# BRIEF §18 on a clean runner: the real installers (published programs, TPK1 payload) installed silently, run,
|
||||
# upgraded in place, uninstalled; .github/scripts/installer-test.ps1 checks every step.
|
||||
installer:
|
||||
name: Installer (windows-latest)
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 45
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
|
||||
# As release.yml publishes them, without ReadyToRun (only start-up time differs).
|
||||
- name: Publish App, Uploader and Setup (win-x64, self-contained single file)
|
||||
run: |
|
||||
foreach ($p in 'Titano.App', 'Titano.Uploader', 'Titano.Setup') {
|
||||
dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained -p:PublishSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=false -o "out/publish/$p"
|
||||
if ($LASTEXITCODE -ne 0) { throw "dotnet publish $p failed" }
|
||||
}
|
||||
|
||||
- name: Build Titano.Tools
|
||||
run: |
|
||||
dotnet build src/Titano.Tools/Titano.Tools.csproj -c Release
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Titano.Tools did not build' }
|
||||
|
||||
# Version 1 ships one more file than version 2: the upgrade must remove it.
|
||||
- name: Pack the installers
|
||||
run: |
|
||||
Copy-Item -Recurse out/publish/Titano.App out/app-v1
|
||||
Set-Content -LiteralPath out/app-v1/legacy.txt -Value 'only in version 1'
|
||||
$installers = @(
|
||||
@('--product', 'Titano', '--version', '1.0.0', '--component', 'Titano=out/app-v1',
|
||||
'--component', 'Uploader=out/publish/Titano.Uploader', '--out', 'out/installers/Titano-Setup-1.0.0.exe'),
|
||||
@('--product', 'Titano', '--version', '1.0.1', '--component', 'Titano=out/publish/Titano.App',
|
||||
'--component', 'Uploader=out/publish/Titano.Uploader', '--out', 'out/installers/Titano-Setup-1.0.1.exe'),
|
||||
@('--product', 'Titano Uploader', '--version', '1.0.1', '--component', 'Uploader=out/publish/Titano.Uploader',
|
||||
'--out', 'out/installers/Titano-Uploader-Setup-1.0.1.exe'))
|
||||
foreach ($installer in $installers) {
|
||||
dotnet $env:TOOLS pack-installer --setup out/publish/Titano.Setup/Titano.Setup.exe @installer
|
||||
if ($LASTEXITCODE -ne 0) { throw "pack-installer $installer failed" }
|
||||
}
|
||||
|
||||
- name: Install, run, upgrade and remove
|
||||
run: |
|
||||
./.github/scripts/installer-test.ps1 -Setup1 out/installers/Titano-Setup-1.0.0.exe -Setup2 out/installers/Titano-Setup-1.0.1.exe `
|
||||
-UploaderSetup out/installers/Titano-Uploader-Setup-1.0.1.exe -Version1 1.0.0 -Version2 1.0.1 -Screenshots out/installer-screenshots
|
||||
|
||||
- name: Setup logs
|
||||
if: always()
|
||||
run: |
|
||||
$logs = Join-Path ([System.IO.Path]::GetTempPath()) 'Titano Setup'
|
||||
if (-not (Test-Path -LiteralPath $logs)) { Write-Host "No setup log in '$logs'"; exit 0 }
|
||||
Get-ChildItem -LiteralPath $logs -Filter *.log -File | Sort-Object Name | ForEach-Object {
|
||||
Write-Host "::group::$($_.Name)"
|
||||
Get-Content -LiteralPath $_.FullName
|
||||
Write-Host '::endgroup::'
|
||||
}
|
||||
|
||||
postgres:
|
||||
name: PostgreSQL ${{ matrix.pg }} integration
|
||||
strategy:
|
||||
@@ -201,11 +285,22 @@ jobs:
|
||||
--health-interval 5s --health-timeout 5s --health-retries 20
|
||||
env:
|
||||
TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=titano-ci;SslMode=disable
|
||||
# Roles, pg_hba lines and TLS made by postgres-ci-setup.sh: with these set, the wire tests of MD5, cleartext, trust
|
||||
# and TLS (BRIEF §6.3) run, and a server that refuses TLS fails them instead of skipping them.
|
||||
TITANO_TEST_PG_MD5: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_md5;Password=md5-ci;SslMode=disable
|
||||
TITANO_TEST_PG_CLEARTEXT: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_clear;Password=clear-ci;SslMode=disable
|
||||
TITANO_TEST_PG_TRUST: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_trust;SslMode=disable
|
||||
TITANO_TEST_PG_TLS: "1"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: global.json
|
||||
# The image starts with TLS off and SCRAM only.
|
||||
- name: Configure PostgreSQL (MD5, cleartext, trust, TLS)
|
||||
run: |
|
||||
bash .github/scripts/postgres-ci-setup.sh "${{ job.services.postgres.id }}" titano titano_test "$RUNNER_TEMP/pg-tls"
|
||||
echo "TITANO_TEST_PG_ROOT_CERT=$RUNNER_TEMP/pg-tls/server.crt" >> "$GITHUB_ENV"
|
||||
- name: Test · Data (PostgreSQL)
|
||||
run: dotnet run --project tests/Titano.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml
|
||||
- name: Test · Server (PostgreSQL)
|
||||
|
||||
@@ -26,7 +26,8 @@ dotnet run --project tests/Titano.Tools.Tests -c Release
|
||||
dotnet run --project tests/Titano.Core.Windows.Tests -c Release # Windows
|
||||
dotnet run --project tests/Titano.App.Tests -c Release # Windows
|
||||
|
||||
# PostgreSQL integration tests (16 or 17)
|
||||
# PostgreSQL integration tests (16 or 17); the MD5, cleartext, trust and TLS tests also read TITANO_TEST_PG_MD5,
|
||||
# _CLEARTEXT, _TRUST, _TLS=1 and _ROOT_CERT (.github/scripts/postgres-ci-setup.sh prepares a server for them)
|
||||
TITANO_TEST_PG="Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=…;SslMode=disable" \
|
||||
dotnet run --project tests/Titano.Data.Tests -c Release
|
||||
|
||||
@@ -38,6 +39,7 @@ dotnet run --project src/Titano.Tools -- package-guard
|
||||
dotnet run --project src/Titano.Tools -- i18n check
|
||||
dotnet run --project src/Titano.Tools -- xaml-lint
|
||||
dotnet format whitespace Titano.slnx --verify-no-changes
|
||||
dotnet run --project src/Titano.Tools -- screenshots diff out/screenshots # Windows, after --capture (tests/visual/baselines/README.md)
|
||||
|
||||
# CC0 RAW samples for the decoder tests (tests/fixtures/manifest.json explains how to fill in URLs)
|
||||
dotnet run --project src/Titano.Tools -- fixtures
|
||||
@@ -59,7 +61,7 @@ The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environ
|
||||
|
||||
| Workflow | When | What |
|
||||
|---|---|---|
|
||||
| `.github/workflows/ci.yml` | push to `main`, pull requests | Windows + Linux build (warnings are errors), all tests, package guard, i18n check, XAML lint, format check, YAML check of workflows and public issue forms, CC0 fixtures (a warning per missing sample), screenshots (`--capture`, also pushed to the `ci-screenshots` branch for same-repository PRs), Windows program artifacts, PostgreSQL 16/17 integration, Docker image smoke test |
|
||||
| `.github/workflows/ci.yml` | push to `main`, pull requests | Windows + Linux build (warnings are errors), all tests, package guard, i18n check, XAML lint, format check, YAML check of workflows and public issue forms, CC0 fixtures (a warning per missing sample), screenshots (`--capture`, also pushed to the `ci-screenshots` branch for same-repository PRs) and their pixel diff against `tests/visual/baselines`, Windows program artifacts, installer test (install, run, upgrade in place, uninstall), PostgreSQL 16/17 integration (SCRAM, MD5, cleartext, trust, TLS), Docker image smoke test |
|
||||
| `.github/workflows/docker.yml` | nightly | `ghcr.io/<owner>/titano-server:nightly` (multi-arch) |
|
||||
| `.github/workflows/perf.yml` | weekly, manual | Performance gates on SQLite and PostgreSQL 17; timings in the job summary |
|
||||
| `.github/workflows/release.yml` | tag `v*`, manual re-publish | The release (below) |
|
||||
|
||||
+16
-6
@@ -16,7 +16,7 @@ Companion to `docs/BRIEF.md` (scope, behaviour) and `docs/ui/DESIGN.md` (looks).
|
||||
| `src/Titano.App` | WPF exe `Titano.exe` | Desktop client |
|
||||
| `src/Titano.Uploader` | WPF exe | Uploader (tray, watch folders, resumable queue) |
|
||||
| `src/Titano.Setup` | WPF exe | In-house installer/uninstaller (TPK1 payload) |
|
||||
| `src/Titano.Tools` | net10.0 exe | CLI: `make-icon`, `i18n` (check, export, missing, import), `xaml-lint`, `package-guard`, `changelog`, `pack-installer`, `selftest`, `diagnose`, `fixtures` |
|
||||
| `src/Titano.Tools` | net10.0 exe | CLI: `make-icon`, `i18n` (check, export, missing, import), `xaml-lint`, `package-guard`, `changelog`, `pack-installer`, `selftest`, `diagnose`, `fixtures`, `screenshots` (diff, accept) |
|
||||
| `tests/Titano.Testing` | net10.0 | In-house test framework (`[Test]`, `[Theory]`+`[Case]`, `[Category]`, `[RequiresEnvironment]`, `[WindowsOnly]`, `[Serial]`, `Assert`, `TestContext`, JUnit) |
|
||||
| `tests/Titano.*.Tests` | exe | One test program per area; `dotnet run --project tests/X -- --junit out.xml` |
|
||||
|
||||
@@ -72,15 +72,15 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S
|
||||
| `Archive` | `CurrentArchive`, `ArchiveTree`, figures for the charts, maintenance reports, mass rename and move, delete and trash dialogs (`SequenceDeletion`, `DeletePlans`), `ArchiveFailures` |
|
||||
| `Server` | `ServerSession`, `ConnectFlow` (trust on first use), `SyncHost` (sync engine, agent, metered hold, editor connections, Export Sync), sync table, `RemoteSequenceApi` |
|
||||
| `Jobs`, `Settings`, `About` | Job list and buffering; settings rows, encoder inventory, language catalog, naming preview; update check and download |
|
||||
| `Infrastructure` | `AppServices` (composition root), `AppSettings`, `AppEnvironment` (installed or portable), `UiLanguage`, `LiveRegion`, `RenderNodeHost`, `DiagnosticsBundle`, `ShellActions` (BRIEF §8.6), device monitor |
|
||||
| `DesignTime` | `SampleData`: the archive, jobs and server the screenshots and smoke tests run on |
|
||||
| `Infrastructure` | `AppServices` (composition root), `AppSettings`, `AppEnvironment` (installed or portable), `AppClock` (today's date, frozen by `--capture`), `UiLanguage`, `LiveRegion`, `RenderNodeHost`, `DiagnosticsBundle`, `ShellActions` (BRIEF §8.6), device monitor |
|
||||
| `DesignTime` | `SampleData`: the archive, jobs and server the screenshots and smoke tests run on, dated from the fixed `SampleData.Now` |
|
||||
|
||||
### 2.4 Titano.Ui and Titano.Server
|
||||
|
||||
| Folder | Content |
|
||||
|---|---|
|
||||
| `Ui/Themes`, `Ui/Theming` | DESIGN tokens (light, dark), typography, control styles, `ThemeManager` |
|
||||
| `Ui/Controls` | `TitanoWindow` (chrome, language direction), `NavRail`, `JobBar`, `ToastHost`, `Field` (placeholder, icon, error), `Chip`, `AutoSlider`, `StatusGlyph`, `EmptyState`, `Icon`, `Bidi` (right-to-left rules) |
|
||||
| `Ui/Controls` | `TitanoWindow` (chrome, language direction), `NavRail`, `JobBar`, `ToastHost`, `Field` (placeholder, icon, error), `Chip`, `AutoSlider`, `StatusGlyph`, `EmptyState`, `Icon`, `Bidi` (right-to-left rules), `Motion` (animations off for screenshots) |
|
||||
| `Ui/Visuals` | `DrawingElement` (hover readout, item keyboard and activation) and its charts (`BarChart`, `SeriesChart`, `StackedBar`, `HeatmapStrip`, `TimelineBands`), `Filmstrip`, `PreviewViewport`, `CurveEditor`, `SequenceCard`, `VirtualizingWrapPanel`, `SegmentedControl`, `SplitButton` |
|
||||
| `Server/Api`, `Server/Events` | Endpoint groups (`XxxEndpoints.Map`), API errors, the WebSocket `EventHub` |
|
||||
| `Server/Security` | Accounts, password hashing, tokens, session cookies, login guard, access rules, audit log |
|
||||
@@ -224,6 +224,9 @@ run as server jobs whose progress comes from the events.
|
||||
- Framework: `Titano.Testing`. Test classes are `public sealed`; constructor may take `TestContext` (temp
|
||||
directories, cancellation, log). `[WindowsOnly]` for OS-specific tests, `[RequiresEnvironment("TITANO_TEST_PG")]`
|
||||
for PostgreSQL integration tests.
|
||||
- Classes run in parallel. A test that changes or observes process-wide state (the UI language, unobserved task
|
||||
exceptions, the managed heap) belongs in a `[Serial]` class; the App and Core test programs fail a test outside one
|
||||
that switches the language away from English (`TestContext.Current`).
|
||||
- Put tests under `tests/Titano.<Area>.Tests/<Folder>/<Thing>Tests.cs`, mirroring the source folder.
|
||||
- `Titano.App.Tests` targets net10.0-windows and runs on Windows CI only: keep logic in plain classes.
|
||||
- Fixtures are synthetic and generated in code wherever possible; tiny binary fixtures may go in `tests/fixtures/`
|
||||
@@ -234,7 +237,14 @@ run as server jobs whose progress comes from the events.
|
||||
500,000-photo library (Library open < 1 s on a new connection pool, filters < 200 ms; the OS cache is warm from
|
||||
building it) and the 100,000-frame rebuild from sidecars (400 sequences of 250 real photos, every column compared,
|
||||
< 120 s), each on SQLite and PostgreSQL. `.github/workflows/perf.yml` runs them weekly against PostgreSQL 17.
|
||||
- `Titano.Tools.Tests` covers the tools whose output CI relies on (fixtures annotations and exit codes).
|
||||
- `Titano.Tools.Tests` covers the tools whose output CI relies on (fixtures annotations and exit codes, the screenshot
|
||||
diff) and the test runner's outcomes.
|
||||
- Visual regression: CI compares the `--capture` screenshots with `tests/visual/baselines` (`Titano.Tools screenshots
|
||||
diff`; its README says how baselines are added). The capture draws the same pixels on any day: the sample's clock
|
||||
is fixed, formats are English and nothing animates.
|
||||
- PostgreSQL: CI prepares the service containers with `.github/scripts/postgres-ci-setup.sh` (MD5, cleartext and
|
||||
trust roles, TLS), so every authentication method and TLS mode of BRIEF §6.3 runs; `TITANO_TEST_PG_TLS=1` makes a
|
||||
server without TLS fail the TLS tests.
|
||||
|
||||
## 7. Localization
|
||||
|
||||
@@ -258,7 +268,7 @@ dotnet format whitespace Titano.slnx --verify-no-changes
|
||||
|
||||
| Workflow | Trigger | Does |
|
||||
|---|---|---|
|
||||
| `ci.yml` | push to `main`, pull requests | Windows + Linux build and tests, guards, i18n, XAML lint, format, fixtures (warnings when missing), screenshots, PostgreSQL 16/17, Docker smoke test |
|
||||
| `ci.yml` | push to `main`, pull requests | Windows + Linux build and tests, guards, i18n, XAML lint, format, fixtures (warnings when missing), screenshots and their pixel diff, installer test (install, run, upgrade, uninstall), PostgreSQL 16/17 (every authentication method, TLS), Docker smoke test |
|
||||
| `release.yml` | tag `v*` (or manual re-publish) | Tests, self-contained publish, optional signing, installers, portable and server zips, SHA256SUMS, release notes, multi-arch GHCR image, public releases repository update and GitHub release |
|
||||
| `docker.yml` | nightly | `ghcr.io/<owner>/titano-server:nightly` |
|
||||
| `perf.yml` | weekly, manual | Performance gates (SQLite, PostgreSQL 17) with timings in the job summary |
|
||||
Reference in new issue
Block a user