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) +}