From c3c9b1e48ab5f02acbf1429b9e13630bcedd6f5a Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 23:27:22 +0200 Subject: [PATCH] test(e2e): two engines + local reconciler, live TAPIR_E2E_RECONCILE=1 runs pianissimo + kb-whisper + gemma4-26b on the audio and asserts the reconciliation is recorded, every contributor is named in the endpoint, and the page says what was done. Run 2026-10-01 on 82 s of synthetic Swedish: 3 disputes, all 3 changed; against the known script 2 were right (virket, a missing 'procent') and 1 was WRONG (Maria -> Vi replaced a correct base reading). A smoke test, not a measurement. Co-Authored-By: Claude Sonnet 5.5 --- cmd/tapir/e2e_upload_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/tapir/e2e_upload_test.go b/cmd/tapir/e2e_upload_test.go index 2432c3b..e4c2803 100644 --- a/cmd/tapir/e2e_upload_test.go +++ b/cmd/tapir/e2e_upload_test.go @@ -74,6 +74,11 @@ func TestE2E_UploadTranscribeAndChat(t *testing.T) { cfg.GatewayKey = key cfg.UploadsEnabled = true cfg.UploadTmpDir = filepath.Join(t.TempDir(), "spool") + if os.Getenv("TAPIR_E2E_RECONCILE") == "1" { + // Two engines and a local model, as ADR-034 describes. + cfg.ReconcileBaseModel = envOrDefault("TAPIR_E2E_BASE_MODEL", "iguana/pianissimo") + cfg.ReconcileModel = envOrDefault("TAPIR_E2E_RECONCILE_MODEL", "iguana/gemma4-26b") + } cfg.FFmpegBin = envOrDefault("TAPIR_E2E_FFMPEG", "ffmpeg") cfg.FFprobeBin = envOrDefault("TAPIR_E2E_FFPROBE", "ffprobe") @@ -134,6 +139,15 @@ func TestE2E_UploadTranscribeAndChat(t *testing.T) { `SELECT status, endpoint, content, audio_seconds, had_video FROM uploaded_transcripts WHERE user_id = $1`, uid). Scan(&status, &endpoint, &content, &secs, &hadVideo)) t.Logf("done: endpoint=%s audio_s=%.1f transcript_chars=%d had_video=%v", endpoint, secs, len(content), hadVideo) + if os.Getenv("TAPIR_E2E_RECONCILE") == "1" { + var recJSON string + require.NoError(t, raw.QueryRow(ctx, + `SELECT COALESCE(reconciliation::text, 'NULL') FROM uploaded_transcripts WHERE user_id = $1`, uid).Scan(&recJSON)) + require.NotEqual(t, "NULL", recJSON, "a two-engine run must record its reconciliation") + t.Logf("reconciliation: %.600s", recJSON) + assert.Contains(t, endpoint, "reconciled by", "every contributor is named in the endpoint") + assert.Contains(t, page, "Reconciled from two transcripts") + } if os.Getenv("TAPIR_E2E_HAD_VIDEO") == "1" { // A Teams meeting with the camera off: a video file whose audio is what matters. assert.True(t, hadVideo, "the file had a video track and the row must say so")