Repository navigation
e2e: name chat sends blocked by a missing model; attach positai.log on external-server runs - #19262
Conversation
sendChatMessage clicked Send as soon as it was visible, so a Send that Posit Assistant kept disabled for lack of a model surfaced as a 10s click timeout. It now waits for Send to enable. When it stays disabled with "Please pick a model", the test skips if Posit AI is unreachable from the runner too (posit-dev/assistant#2850) and otherwise fails naming that state. Addresses #19261.
Session logs were attached only on Desktop, where the harness can read the log directory, so the Linux Server CI failure in #19255 carried no record of what the Posit Assistant backend fetched. On external-server runs the fixture now fetches positai.log through the session's /files/ endpoint, from the account's default data home, and attaches the entries stamped since the failing test started. Addresses #19261.
The check matched "pick a model" anywhere in the chat frame, so a chat message with that phrase could turn an unrelated disabled Send into the no-model failure and its outage check. It now reads only the text Send's aria-describedby points at. The harness test that sends now starts with Send disabled and enables it later than click()'s own wait would last, so it covers the wait itself. Addresses #19261.
The fetch kept only the origin of PW_RSTUDIO_SERVER_URL, so a server served under a path prefix (https://host/rstudio) got a request for /files/... instead of /rstudio/files/... and the log was never attached. /files/ is now resolved under the configured URL. Addresses #19261.
gtritchie
left a comment
There was a problem hiding this comment.
Automated review: 8 findings, posted inline. The deaf-session fetch delay is the main one. The rest are edge cases outside CI (clock skew, log size, a silent non-log 200), a possibly masked timeout error, and cleanup nits. Nothing here blocks.
| } | ||
|
|
||
| const slice = logSince(log, since); | ||
| if (slice.trim() !== '') |
There was a problem hiding this comment.
A 200 that isn't the log goes through here as '' with no message. page.request follows redirects, so the sign-in page after an expired cookie, or any page served at <serverUrl>/files/ when the session lives somewhere else, quietly attaches nothing. Nothing in the run would show that the attachment never works on that server. A console.warn when a 200 body has no stamped lines would surface it.
/files/ accepts a request with neither Sec-Fetch-Site nor Referer (SessionFiles.cpp), which is what page.request sends. Addresses #19261.
RStudio E2E - all platforms3 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
Two e2e harness changes, prompted by
plots-pane-activation.test.tsfailing on Linux Server in #19255 and #19256. In both runs Posit Assistant had briefly lost its model list and showed its provider-setup overlay (posit-dev/assistant#2850), so Send stayed disabled. The tests reported a bare 10 ssendBtn.click()timeout and had no backend log to explain it.Send blocked by a missing model.
sendChatMessagenow waits up to 15 s for Send to enable after typing, instead of clicking it as soon as it is visible. If Send stays disabled and itsaria-describedbytext says "Please pick a model", the test skips when Posit AI is unreachable from the runner too (skipIfAiServiceGone, the existing outage policy). Otherwise it fails with a message naming the no-model state. A Send disabled for any other reason, or one that leaves the page before its description can be read, fails with the plain timeout, as before.positai.log on external-server runs. Session logs are attached to failures only on Desktop, where the harness can read the log directory. When
PW_RSTUDIO_SERVER_URLis set, the fixture now fetchespositai.logthrough the session's/files/endpoint and attaches the entries stamped since the failing test started. The fetch uses the account's default data home (~/.local/share/rstudio/log/), the same assumptionremote-provision.tsmakes for credential stores, and builds the URL under the configured server URL, including any path prefix. A missing (404) or empty log is skipped quietly. A response with no timestamped lines, such as a sign-in page reached through a redirect, is logged and dropped, as are other fetch errors, so none can mask the test's own failure. The fetch is skipped once the fixture has found the session deaf, since a deaf session can't serve/files/. The account's sessions share the log, so other workers' entries can be interleaved. The README's failure-diagnostics section describes this.Servers the harness spawns itself (
test:server-dev) still attach no session logs.Fixes #19261.
Testing
tests/harness/chat-send-no-model.test.ts: Send that enables after typing, later thanclick()'s own 10 s wait (fails without the new wait); Send disabled for lack of a model (outage check, then the named failure); Send disabled for another reason, with the phrase elsewhere in the chat (plain timeout, no outage check); Send removed from the page during the wait (plain timeout, no outage check).tests/harness/remote-session-logs.test.ts: trimming the log to a test's entries, including multi-line entries; fetching it from a local HTTP server at the root and under a path prefix, and on 404, 500 and connection refused; a non-log answer (warns), and an empty log or one with no recent entries (no attachment, no warning)./files/.local/share/rstudio/log/positai.logreturned the log (HTTP 200) and a missing log returned 404.npx tsc --noEmitis clean. The full chat e2e suite was not run against a live assistant.