diff --git a/automation/utils.ts b/automation/utils.ts index 067516f2..a55e9a5f 100644 --- a/automation/utils.ts +++ b/automation/utils.ts @@ -20,7 +20,8 @@ import * as _ from 'lodash'; import * as path from 'path'; import * as shellEscape from 'shell-escape'; -export const MSYS2_BASH = 'C:\\msys64\\usr\\bin\\bash.exe'; +export const MSYS2_BASH = + process.env.MSYSSHELLPATH || 'C:\\msys64\\usr\\bin\\bash.exe'; export const ROOT = path.join(__dirname, '..'); /** Tap and buffer this process' stdout and stderr */ diff --git a/patches/all/qqjs+0.3.11.patch b/patches/all/qqjs+0.3.11.dev.patch similarity index 100% rename from patches/all/qqjs+0.3.11.patch rename to patches/all/qqjs+0.3.11.dev.patch diff --git a/tests/commands/ssh.spec.ts b/tests/commands/ssh.spec.ts index 26bff547..d617cf48 100644 --- a/tests/commands/ssh.spec.ts +++ b/tests/commands/ssh.spec.ts @@ -120,6 +120,13 @@ describe('balena ssh', function () { async function checkSsh(): Promise { const { which } = await import('../../build/utils/helpers'); const sshPath = await which('ssh', false); + if ((sshPath || '').includes('\\Windows\\System32\\OpenSSH\\ssh')) { + // don't use Windows' built-in ssh tool for these test cases + // because it messes up with the terminal window such that + // "line breaks stop working" (and not even '\033c' fixes it) + // and all mocha output gets printed on a single very long line... + return false; + } return !!sshPath; } @@ -127,11 +134,13 @@ async function checkSsh(): Promise { async function startMockSshServer(): Promise<[Server, number]> { const server = createServer((c) => { // 'connection' listener - c.on('end', () => { + const handler = (msg: string) => { if (process.env.DEBUG) { - console.error('[debug] mock ssh server: client disconnected'); + console.error(`[debug] mock ssh server: ${msg}`); } - }); + }; + c.on('error', (err) => handler(err.message)); + c.on('end', () => handler('client disconnected')); c.end(); }); server.on('error', (err) => {