util

package
v0.0.0-...-68360ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTiDBVersion

func CheckTiDBVersion(r *require.Assertions, constraint string) bool

CheckTiDBVersion tests if tidb version satisfies the constraints. Constraint examples: "~5.2.2", ">= 5.3.0", see github.com/Masterminds/semver to get more information.

func GetTiDBVersion

func GetTiDBVersion(t *testing.T, testDB *testutil.TestDB) string

func LoadFixtures

func LoadFixtures(t *testing.T, testDB *testutil.TestDB, dir string)

func TestReqWithHandlers

func TestReqWithHandlers(req *http.Request, handlers ...gin.HandlerFunc) (*gin.Context, *httptest.ResponseRecorder)

Types

type App

type App struct {
	*fxtest.App
	// contains filtered or unexported fields
}

func NewMockApp

func NewMockApp(tb fxtest.TB, tidbVersion string, c *config.Config, opts ...fx.Option) *App

func (*App) RequireStart

func (app *App) RequireStart() *App

RequireStart calls Start, failing the test if an error is encountered. It also sleep 5 seconds to wait for the server to start.

func (*App) RequireStop

func (app *App) RequireStop()

RequireStop calls Stop, failing the test if an error is encountered.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL