Skip to content

test(device ssh): unset proxy env vars that break stderr assertions#3088

Merged
flowzone-app[bot] merged 1 commit intomasterfrom
kyle/fix-ssh-test-proxy
Apr 8, 2026
Merged

test(device ssh): unset proxy env vars that break stderr assertions#3088
flowzone-app[bot] merged 1 commit intomasterfrom
kyle/fix-ssh-test-proxy

Conversation

@klutchell
Copy link
Copy Markdown
Contributor

@klutchell klutchell commented Apr 7, 2026

device ssh tests assert stderr is empty, but environments with npm security wrappers may inject HTTPS_PROXY, causing getProxyConfig() to detect a proxy and emit a proxytunnel warning that fails the assertion

Unset HTTPS_PROXY and HTTP_PROXY in beforeEach and restore in afterEach so the warnings are never emitted — keeps expect(err).to.be.empty as a strict assertion

See: https://balena.fibery.io/Work/Improvement/Update-balena-CLI-ssh-tests-to-unset-HTTPS_PROXY-4043

@klutchell klutchell marked this pull request as draft April 7, 2026 18:12
@klutchell klutchell force-pushed the kyle/fix-ssh-test-proxy branch from eed53e5 to 521fe76 Compare April 7, 2026 18:54
@klutchell klutchell changed the title test(device ssh): filter proxy warnings from stderr assertions test(device ssh): unset proxy env vars that break stderr assertions Apr 7, 2026
@klutchell klutchell force-pushed the kyle/fix-ssh-test-proxy branch from 521fe76 to e40731e Compare April 7, 2026 18:56
npm security wrappers may inject HTTPS_PROXY into the process
environment, causing getProxyConfig() to detect a proxy and emit a
proxytunnel warning on stderr. These tests use mocked SSH and don't
need proxying, so save and unset HTTPS_PROXY and HTTP_PROXY in
beforeEach, restoring them in afterEach.

Change-type: patch
Signed-off-by: Kyle Harding <kyle@balena.io>
@klutchell klutchell force-pushed the kyle/fix-ssh-test-proxy branch from e40731e to a97edb0 Compare April 7, 2026 18:56
@klutchell klutchell marked this pull request as ready for review April 7, 2026 18:56
@klutchell klutchell requested a review from aethernet April 7, 2026 19:03
@flowzone-app flowzone-app bot enabled auto-merge April 7, 2026 20:20
@flowzone-app flowzone-app bot merged commit 626ff6a into master Apr 8, 2026
60 checks passed
@flowzone-app flowzone-app bot deleted the kyle/fix-ssh-test-proxy branch April 8, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants