test(e2e): verify serverless SSH remote window and file transfers - #2194
test(e2e): verify serverless SSH remote window and file transfers#2194anton-107 wants to merge 6 commits into
Conversation
|
🤖 Integration tests ❌ failed for |
|
🤖 Integration tests ❌ failed for |
CI runners cannot reach the marketplace and no Remote SSH VSIX is vendored in EXTENSION_VSIX_DIR, so its marketplace fallback failed the whole `code --install-extension` batch. wdio only logs a beforeSession rejection, so the session continued with nothing installed and the spec failed on its own configuration assert, pointing away from the cause. Install the extension dependencies and the VSIX under test in one call that must succeed, Remote SSH in its own best-effort call, and log the CLI's output when an install fails so the reason reaches the job log. Vendoring the VSIX makes the spec run again with no further change here. Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 Integration tests ✅ passed for |
rugpanov
left a comment
There was a problem hiding this comment.
Review notes
All test/tooling changes — no shipped extension code. CI is green (Integration Tests + unit). The findings below are about test-suite integrity and reliability, not the extension itself.
Blocking / please address
1. The SSH skip is keyed on Remote-SSH install availability, which both hides coverage and lets the spec leak into the default run.
wdio.conf.ts (beforeSession, catch → TEST_SSH_SKIP_REASON) · ssh_connection.ucws.e2e.ts:18
- Any Remote-SSH install failure (no vendored VSIX / no marketplace) silently becomes a skip, so the job can pass with zero SSH coverage.
- Conversely, the default
specsglob**/*.e2e.tsmatches this spec andtest:integ/test:integ:extensionrun with no--spec. If Remote SSH is installed but the workspace isn't the serverless-SSH target, the spec runs andfindQuickPick("Serverless")times out (fail) rather than skipping. - Suggest: make skip an explicit opt-in and distinguish "dependency missing → fail the SSH job" from "not an SSH job → skip". Could you confirm how the e2e job invokes the runner (
--specvs full glob)?
2. dismissRemoteWelcome can throw inside the 8-minute waitUntil and abort a passing run.
ssh_connection.ucws.e2e.ts:197-212 (called from the waits at ~453 and ~492)
action.click()on a stale element, orwaitForDisplayed({reverse, timeout:10_000})when the button doesn't vanish, throws — and a throw in awaitUntilcondition rejects immediately, failing the spec on a transient onboarding-UI race.- Suggest: wrap the click + reverse-wait in try/catch so dismissal is best-effort.
3. The 12-minute test timeout is shorter than the worst-case sum of the internal waits.
ssh_connection.ucws.e2e.ts:12
- login 120s + new-window 180s + ui-ready 480s + picker/explorer/editor/cleanup 4×30s ≈ 15+ min. A slow-but-progressing run is killed by the generic mocha timeout before the targeted
timeoutMsgdiagnostics and thefinallycleanup run. - Suggest: raise the outer timeout above the aggregate, or drive the flow from one shared deadline.
Should-fix
4. Local runs accumulate credential-bearing temp roots that are never cleaned.
run-e2e.mjs:28 (mkdtempSync per run) · wdio.conf.ts:463 + writeDatabricksConfig (writes token/client_secret into .databrickscfg)
- Each local invocation mints a fresh temp root and leaves behind the
.databrickscfgplus hundreds of MiB of VS Code/extension data.onPrepare's start-of-runfs.rmonly clears the new (empty) root. CI is unaffected (it leavesTEST_E2E_ROOTunset). - Suggest: remove the credential-bearing workspace/extension dirs on success, failure, and signals; keep the redacted logs.
5. The probe has no per-operation timeout, so a hung remote FS op leaves the remote window/tunnel open.
ssh-test-probe/extension.js:51 (never reaches closeWindow at line 123)
- The spec still fails via its own 8-min wait, but nothing force-closes the remote window/tunnel on that path.
- Suggest: add op-level watchdog timeouts in the probe and explicitly close the remote window/tunnel from the test teardown.
6. beforeSession rewrites the settings.json that wdio-vscode-service also writes, relying on hook ordering.
wdio.conf.ts (the "The service has already written settings before this user hook runs" block)
- If that ordering ever flips, the read hits ENOENT/partial JSON, or the service overwrites the SSH settings afterward (losing
remote.SSH.configFile, trust-disable, terminal profile). - Suggest: confirm the order holds, or supply these through the service config instead of rewriting the file.
7. run-e2e.mjs --profile runs bare databricks and its error message is misleading on non-auth failures.
run-e2e.mjs:34 (cliJson), catch at ~37
- A fresh clone only has the package-local
bin/databricks; baredatabricksmay be missing or a different version. The catch also always says "Cannot resolve profile… run databricks auth login" even for ENOENT/timeout. (Token correctly kept out of the message.) - Suggest: invoke the package-local CLI explicitly and distinguish "CLI missing/timed out" from an auth failure.
Nits
- win32
code.cmdshim is unexercised (sshE2eUtils.ts:47-56): no Windows default terminal profile is configured, so this path is effectively posix-only — either validate on Windows CI or document it. - Spec identity relies on
globSyncnormalizing to exactlyssh_connection.ucws.e2e.tsin two places (capabilities getter +onPrepare); a divergence (case-insensitive FS, symlinked tmp root) could route the spec to the wrong capability. Matches on posix.
Confirmed clean
package-vsix.sh mktemp+EXIT-trap (preserves uncommitted edits — improvement over git checkout --) · commonUtils.ts !title fallback (safe superset of === null) · capability wdio:exclude/splice routing · transfer hashing + atomic .tmp-rename reporting (deadlines resolve to failures, not hangs) · assert→with {type:"json"} update · token scrubbing in run-e2e.mjs.
Two items (#1 runner invocation, #6 hook ordering) depend on the external e2e setup, which isn't visible from this repo — worth a note from you.
Address review feedback on the serverless SSH e2e spec. Replace the install-availability skip with a TEST_SSH_E2E opt-in. The skip conflated two cases: any Remote SSH install failure became a silent skip, so the job could pass with no SSH coverage, and the default `**/*.e2e.ts` glob swept the spec into runs whose workspace offers no serverless SSH compute, where it failed at the quick pick instead of staying out of the way. Now the spec is excluded outright without the flag, and with it a missing Remote SSH fails the run. Match the spec by base name from one helper so the capability router and beforeSession cannot disagree. Make `dismissRemoteWelcome` best-effort: it runs inside `waitUntil` conditions, where a stale-element click or a button that does not vanish rejected the whole wait and failed an otherwise passing run. Raise the outer test timeout above the sum of the internal waits, so a slow but progressing run is reported by the wait that stalled — with its targeted message — and still runs its cleanup. Give the probe per-operation watchdogs and close the remote window from the spec's teardown, so a wedged remote filesystem call can no longer leave the remote window and tunnel open. Remove the credential-bearing temp root the local runner mints, on success, failure and signals, keeping the logs; each run had been leaving a .databrickscfg and several hundred MiB of editor data behind. Supply the SSH settings through the service capability as well as the settings file, so the result no longer depends on which hook writes first. Resolve the package-local CLI in the runner instead of a bare `databricks`, and distinguish a missing or timed-out CLI from an auth failure. Document the opt-in, and note that the Windows shim is unexercised. Co-authored-by: Isaac <no-reply@databricks.com>
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
|
Thanks — all seven findings and both nits are addressed in 5f1b500. Taking your two open questions first, since they shaped the fixes. How the e2e job invokes the runner (#1). From this repo: Hook ordering (#6). I couldn't verify it, so instead of confirming the order I removed the dependency on it. Blocking1. Skip keyed on Remote-SSH availability. Replaced with a 2. 3. Test timeout below the aggregate. Raised to 18 min, with the budget written out in the comment (login 120 + input 10 + picker 30 + window 180 + probe 480 + explorer 30 + editor 30 + close 30 + probe cleanup 30 = 940s) so a future edit to any wait notices the ceiling. Should-fix4. Credential-bearing temp roots. The runner now removes 5. No per-operation timeout in the probe. Every 6. 7. Bare Nits
Documented the opt-in in CONTRIBUTING.md as well. One caveat worth flagging: I couldn't run |
|
🤖 Integration tests running for |
Changes
Add a real-workspace serverless SSH end-to-end test. It invokes the extension's tunnel command, switches to the new Remote SSH window, dismisses onboarding, opens a file from Explorer, and checks the editor content. A small test extension verifies three complete 8 MiB remote file round trips with gaps between them and removes the test files afterward.
Only the SSH spec uses a current VS Code release for Remote SSH compatibility; existing specs retain the extension's minimum supported editor version.
The
.ucws.e2e.tssuffix selects the existing serverless CI workspace credentials. Running this spec alone does not start a dedicated cluster. Remote SSH installs through the existing vendored-VSIX mechanism; its optional extension pack is excluded.Include an isolated local runner with explicit OAuth-profile support and WebdriverIO 9 executable resolution, generic single-spec documentation, and a packaging fix that preserves local package.json edits. The view-title lookup handles missing and empty title attributes in newer VS Code versions.
Tests
PERMISSION_DENIED: Traffic on this port is not permitted, before the remote window opens. CI also needs Remote SSH available in its existing EXTENSION_VSIX_DIR.