test(gmail): extend live no-send smokes

This commit is contained in:
Peter Steinberger 2026-04-20 19:06:48 +01:00
parent 0ea676369d
commit 35d0ff4f47
No known key found for this signature in database
3 changed files with 26 additions and 0 deletions

View File

@ -28,6 +28,7 @@ Options:
Skip keys (base):
time, version, completion, auth, auth-alias, config, enable-commands,
gmail, gmail-settings, gmail-delegates, gmail-batch-delete, gmail-history, gmail-url, gmail-labels,
gmail-send-safety, gmail-forward,
gmail-attachments, gmail-track, gmail-watch, drive, docs, sheets, slides,
calendar, calendar-enterprise, calendar-respond, calendar-team, calendar-users,
tasks, contacts, people, groups, keep, classroom

View File

@ -45,5 +45,11 @@ run_core_tests() {
else
echo "gmail-no-send block OK"
fi
if $BIN --gmail-no-send gmail fwd msg-1 --to nobody@example.com >/dev/null 2>&1; then
echo "Expected gmail-no-send to block forward alias, but it succeeded" >&2
exit 1
else
echo "gmail-no-send forward alias block OK"
fi
fi
}

View File

@ -138,11 +138,30 @@ run_gmail_tests() {
send_thread_id=$(extract_field "$send_json" threadId)
[ -n "$send_msg_id" ] || { echo "Failed to parse send message id" >&2; exit 1; }
if skip "gmail-send-safety"; then
echo "==> gmail send no-send block (skipped)"
elif gog --gmail-no-send gmail send --to "$EMAIL_TEST" --subject "blocked $TS" --body "blocked" --json >/dev/null 2>&1; then
echo "Expected gmail-no-send to block gmail send, but it succeeded" >&2
exit 1
else
echo "gmail send no-send block OK"
fi
local message_json history_id
echo "==> gmail get message"
message_json=$(gog gmail get "$send_msg_id" --json)
history_id=$(extract_history_id "$message_json")
run_required "gmail-forward" "gmail forward dry-run" gog --dry-run gmail forward "$send_msg_id" --to "$EMAIL_TEST" --note "dry-run smoke $TS" --json >/dev/null
if skip "gmail-forward"; then
echo "==> gmail forward no-send block (skipped)"
elif gog --gmail-no-send gmail forward "$send_msg_id" --to "$EMAIL_TEST" --note "blocked $TS" --json >/dev/null 2>&1; then
echo "Expected gmail-no-send to block gmail forward, but it succeeded" >&2
exit 1
else
echo "gmail forward no-send block OK"
fi
if [ -n "$history_id" ]; then
run_optional "gmail-history" "gmail history" gog gmail history --since "$history_id" --json --max 5 >/dev/null
else