From b492a3144e4dab58dc286cf214a42e8420b2b9df Mon Sep 17 00:00:00 2001 From: Mathias Date: Thu, 1 Oct 2026 23:25:10 +0200 Subject: [PATCH] test(cmd): the base-engine setting turns on the ensemble, and nothing else does (red) Red: buildTranscriber is undefined. Co-Authored-By: Claude Sonnet 5.5 --- cmd/tapir/uploads_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/cmd/tapir/uploads_test.go b/cmd/tapir/uploads_test.go index 9a55b62..f91e782 100644 --- a/cmd/tapir/uploads_test.go +++ b/cmd/tapir/uploads_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "git.d-ma.be/mathias/tapir/internal/adapters/transcribe" "git.d-ma.be/mathias/tapir/internal/config" "git.d-ma.be/mathias/tapir/internal/domain" "git.d-ma.be/mathias/tapir/internal/web" @@ -154,3 +155,33 @@ func TestWireUploads_NilIntakeLeavesTheAppUntouched(t *testing.T) { assert.Nil(t, app.Uploads, "a nil *Intake must not become a non-nil interface that mounts the routes") assert.Zero(t, app.UploadChatMaxChars) } + +func TestBuildTranscriber_DefaultIsTheSingleEngineChainAsBefore(t *testing.T) { + cfg := uploadCfg(t, true) + + tr := buildTranscriber(cfg) + + assert.IsType(t, &transcribe.Chain{}, tr, "with no base engine configured nothing changes") +} + +func TestBuildTranscriber_ABaseEngineTurnsOnTheEnsemble(t *testing.T) { + cfg := uploadCfg(t, true) + cfg.ReconcileBaseModel = "iguana/pianissimo" + cfg.ReconcileModel = "iguana/gemma4-26b" + + tr := buildTranscriber(cfg) + + assert.IsType(t, &transcribe.Ensemble{}, tr) +} + +func TestBuildUploads_WiresTheEnsembleWhenConfigured(t *testing.T) { + cfg := uploadCfg(t, true) + cfg.ReconcileBaseModel = "iguana/pianissimo" + cfg.ReconcileModel = "iguana/gemma4-26b" + + in, w, err := buildUploads(context.Background(), cfg, &fakeUploadsStore{}, quietLog()) + + require.NoError(t, err) + assert.NotNil(t, in) + assert.NotNil(t, w) +}