package app

import (
	"context"
	"os"
	"testing"

	"github.com/tidbcloud/AgentTeam/internal/coredb"
	"github.com/tidbcloud/AgentTeam/internal/coredb/testkit"
)

var appTiDB testkit.TiDBCoreDBFixture

func TestMain(m *testing.M) {
	os.Exit(testkit.RunTestsWithTiDBCoreDBFixture(m, "app", &appTiDB))
}

func startAppRollbackDB(t *testing.T, ctx context.Context) coredb.DB {
	t.Helper()
	return appTiDB.RollbackDB(t, ctx)
}
