refactor: enable all e2e tests and fix audio port naming

This commit is contained in:
Loic Coenen
2026-06-05 19:39:53 +00:00
committed by Loic Coenen (aider)
parent 20176517a4
commit 32fb5d3524
7 changed files with 174 additions and 132 deletions

View File

@@ -259,8 +259,9 @@ async function testGridNavigation(): Promise<void> {
// Cycle back to origin
tmuxSendKeys("looper", "0", "h");
await wait(400);
tmuxSendKeys("looper", "0", "k");
await wait(200);
await wait(400);
pane = tmuxCapturePane("looper", "0");
if (pane.includes("Selected: Grid 0, Row 0, Col 0")) {
console.log(" PASS: Returned to origin");
@@ -472,8 +473,8 @@ async function testTUIRecordAndLoop(): Promise<void> {
}
console.log(" PASS: TUI grid shows 'R' indicator");
// Play tone into looper:input (3 seconds)
execSync(`${GEN_TONE_BIN} 3.0 "looper:input"`, { timeout: 8000 });
// Play tone into looper:ch0in (3 seconds)
execSync(`${GEN_TONE_BIN} 3.0 "looper:ch0in"`, { timeout: 8000 });
// press 't' again to stop recording -> loop
tmuxSendKeys("looper", "0", "t");
@@ -552,7 +553,7 @@ async function testSaveLoad(): Promise<void> {
}
// Play tone into looper:input using gen_tone (synchronous, blocks until done)
execSync(`${GEN_TONE_BIN} 3.0 "looper:input"`, { timeout: 8000 }); // 3 seconds tone
execSync(`${GEN_TONE_BIN} 3.0 "looper:ch0in"`, { timeout: 8000 }); // 3 seconds tone
// Stop recording (toggle again -> loop)
writeFifoCommand("record 0");
@@ -1099,7 +1100,7 @@ async function testStatusFifoLevelLine(): Promise<void> {
// Play tone directly (not through TUI)
ensureGenTone();
execSync(`${GEN_TONE_BIN} 1.0 "looper:input"`, { timeout: 5000 });
execSync(`${GEN_TONE_BIN} 1.0 "looper:ch0in"`, { timeout: 5000 });
// Wait for engine to write status
await wait(2000);
@@ -1129,16 +1130,13 @@ async function testVUMeter(): Promise<void> {
// Capture initial VU line (should be empty/spaces)
let pane = tmuxCapturePane("looper", "0");
const paneLines = pane.split("\n");
const ooIndex = paneLines.findIndex(l => l.trim().startsWith("o:"));
let vuLineBefore = "";
if (ooIndex >= 0 && ooIndex + 1 < paneLines.length) {
vuLineBefore = paneLines[ooIndex + 1];
}
// Look for any line containing x or # that is the VU meter line.
const vuLineBefore = paneLines.find(l => /[x#]/.test(l)) || "";
console.log(` Initial VU line: "${vuLineBefore.trim()}"`);
// Generate tone in background (does not block the test)
ensureGenTone();
const toneProc = exec(`${GEN_TONE_BIN} 3.0 "looper:input"`, { timeout: 8000 });
const toneProc = exec(`${GEN_TONE_BIN} 3.0 "looper:ch0in"`, { timeout: 8000 });
// Wait for audio to start reaching the meter
await wait(1500);
@@ -1146,11 +1144,8 @@ async function testVUMeter(): Promise<void> {
// Capture pane while tone is playing
pane = tmuxCapturePane("looper", "0");
const paneLines2 = pane.split("\n");
const ooIndex2 = paneLines2.findIndex(l => l.trim().startsWith("o:"));
let vuLineDuring = "";
if (ooIndex2 >= 0 && ooIndex2 + 1 < paneLines2.length) {
vuLineDuring = paneLines2[ooIndex2 + 1];
}
// Same detection as above
const vuLineDuring = paneLines2.find(l => /[x#]/.test(l)) || "";
console.log(` VU line during tone: "${vuLineDuring.trim()}"`);
// The VU meter should show non-space characters (at least one 'x' or '#')
@@ -1175,21 +1170,21 @@ async function main(): Promise<void> {
console.log("=== Looper E2E Tests ===\n");
const tests = [
//testGridNavigation,
//testChannelAddRemove,
//testToggleRecordStop,
//testTUIRecordAndLoop,
//testRecordOnSelectedCell,
testGridNavigation,
testChannelAddRemove,
testToggleRecordStop,
testTUIRecordAndLoop,
testRecordOnSelectedCell,
testSaveLoad,
//testRecordOnMissingChannel,
//testRapidKeyMashConsistency,
//testRecordOnHighRow,
testRecordOnMissingChannel,
testRapidKeyMashConsistency,
testRecordOnHighRow,
testFromToAudioPass,
//testRecordMoveRecord,
//testStressRandomUsage,
//testKeyPressLatency,
//testStatusFifoLevelLine,
//testVUMeter
testRecordMoveRecord,
testStressRandomUsage,
testKeyPressLatency,
testStatusFifoLevelLine,
testVUMeter
];
let passCount = 0;
let failCount = 0;