diff --git a/scripts/ci/ios-sim/avatar.swift b/scripts/ci/ios-sim/avatar.swift index 9a7e239516..e1b0925335 100644 --- a/scripts/ci/ios-sim/avatar.swift +++ b/scripts/ci/ios-sim/avatar.swift @@ -2,7 +2,7 @@ // a JPEG at quality 0.85 drawn at scale 1, shrunk by sqrt(size / 12500), at most halved per step, // until its data URI is at most 12500 characters. The picture is synthetic and photo-like: a gradient, // discs and noise, with more noise for a higher detail. -// Usage: avatar +// Usage: avatar [side in pixels, default 1024] import CoreGraphics import Foundation @@ -70,12 +70,12 @@ func reduced(_ image: CGImage, ratio: Double) -> CGImage { } let args = CommandLine.arguments -guard args.count == 4, let seed = UInt64(args[1]), let detail = Double(args[2]) else { - print("usage: avatar ") +guard args.count == 4 || args.count == 5, let seed = UInt64(args[1]), let detail = Double(args[2]), let side = Int(args.count == 5 ? args[4] : "1024") else { + print("usage: avatar [side in pixels, default 1024]") exit(1) } var generator = Random(state: seed) -var image = picture(side: 1024, detail: detail, random: &generator) +var image = picture(side: side, detail: detail, random: &generator) var uri = jpegDataURI(image) var steps = 0 while uri.count > maxDataSize { diff --git a/scripts/ci/ios-sim/backend.sh b/scripts/ci/ios-sim/backend.sh index 32f497f1b6..cdffa46973 100755 --- a/scripts/ci/ios-sim/backend.sh +++ b/scripts/ci/ios-sim/backend.sh @@ -224,13 +224,17 @@ new_address() { esac } -# Avatars at the size the app makes them (avatar.swift), with different amounts of detail. +# Avatars at the size the app makes them (avatar.swift), with different amounts of detail; +# and small ones for the smoke test's entries, so that its two search results still arrive in one response. make_avatars() { xcrun swiftc -O -o "$work/avatar" "$(dirname "$0")/avatar.swift" local i for i in 1 2 3 4 5 6; do "$work/avatar" "$i" "0.$((i + 2))" "$work/avatar-$i.txt" done + for i in 7 8 9; do + "$work/avatar" "$i" 0 "$work/avatar-$i.txt" 64 + done } seed_avatars() { @@ -402,7 +406,8 @@ write_seed() { echo echo "| Search with | Entries | Seeded for |" echo "|---|---|---|" - echo "| \`$search_text\` | ci_group (group, no avatar), ci_channel (channel, no avatar) | the smoke test; results on one page |" + echo "| \`$search_text\` | ci_group (group), ci_channel (channel), each with a small avatar (64 px) | the smoke test; results on one page |" + echo "| \`ci cards\` | ci_cards (channel, with a small avatar) | the smoke test joins it, so that the chat list shows its cards |" echo "| \`$avatar_search_text\` | ci_avatar_g1…3 (groups), ci_avatar_c1…3 (channels), each with an avatar the size the app makes | avatars and the response size limit: about one entry per page |" echo "| \`ci long\` | $long_name (group): a long name and a two-line description | D3 |" echo "| \`ci markdown\` | ci_markdown (group): markdown in the description | D5 |" @@ -446,9 +451,10 @@ start() { start_directory "0:nobody" trap dump_directory EXIT connect_admin - seed_group ci_group "CI seed group" + seed_group ci_group "CI seed group" "$work/avatar-7.txt" setup_relay - seed_channel ci_channel "CI seed channel" + seed_channel ci_channel "CI seed channel" "$work/avatar-8.txt" + seed_channel ci_cards "CI cards channel" "$work/avatar-9.txt" seed_avatars seed_group "$long_name" "CI long entry: a description long enough to take two lines in the directory results, to check how the row truncates" seed_group ci_markdown "CI markdown *bold* _italic_ [x](https://example.com)" @@ -456,6 +462,7 @@ start() { probe_search probe_names write_seed + probe_pages "$search_text" 2 probe_pages "$avatar_search_text" 6 }