test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestCases = make([]*TestCase, 0)

Functions

func ExecLatestTest

func ExecLatestTest(t *testing.T, dependencyName, moduleName string, minVersion, maxVersion *version.Version, testFunc func(*testing.T, ...string))

func ExecMuzzle

func ExecMuzzle(t *testing.T, dependencyName, moduleName string, minVersion, maxVersion *version.Version, muzzleClasses []string)

func ExpectContains

func ExpectContains(t *testing.T, text, expect string)

func ExpectContainsAllItem

func ExpectContainsAllItem(t *testing.T, actualItems []string, expectedItems ...string)

func ExpectContainsNothing

func ExpectContainsNothing(t *testing.T, actualItems []string)

func ExpectInstrumentContains

func ExpectInstrumentContains(t *testing.T, log string, rule string)

func ExpectInstrumentNotContains

func ExpectInstrumentNotContains(t *testing.T, log string, rule string)

func ExpectNotContains

func ExpectNotContains(t *testing.T, text, expect string)

func ExpectPreprocessContains

func ExpectPreprocessContains(t *testing.T, log string, rule string)

func ExpectPreprocessNotContains

func ExpectPreprocessNotContains(t *testing.T, log string, rule string)

func ExpectSame

func ExpectSame(t *testing.T, expected, actual string)

func ExpectStderrContains

func ExpectStderrContains(t *testing.T, expect string)

func ExpectStdoutContains

func ExpectStdoutContains(t *testing.T, expect string)

func ExpectWhen

func ExpectWhen(t *testing.T, prediction func() (res bool, msg string))

func FetchVersion

func FetchVersion(t *testing.T, dependency, version string) string

func ReadInstrumentLog

func ReadInstrumentLog(t *testing.T, fileName string) string

func ReadPreprocessLog

func ReadPreprocessLog(t *testing.T, fileName string) string

func RunApp

func RunApp(t *testing.T, appName string, env ...string) (string, string)

func RunGoBuild

func RunGoBuild(t *testing.T, args ...string)

func RunGoBuildFallible added in v0.4.1

func RunGoBuildFallible(t *testing.T, args ...string)

func RunGoBuildWithEnv added in v0.5.0

func RunGoBuildWithEnv(t *testing.T, envs []string, args ...string)

func RunSet added in v0.4.1

func RunSet(t *testing.T, args ...string)

func RunVersion added in v0.4.1

func RunVersion(t *testing.T)

func TBuildAppNoop

func TBuildAppNoop(t *testing.T, appName string, muzzleClasses ...string)

func TestBasicEcho added in v0.0.2

func TestBasicEcho(t *testing.T, env ...string)

func TestBasicFastHttp added in v0.3.0

func TestBasicFastHttp(t *testing.T, env ...string)

func TestBasicFastHttps added in v0.3.0

func TestBasicFastHttps(t *testing.T, env ...string)

func TestBasicFiberv2 added in v0.4.0

func TestBasicFiberv2(t *testing.T, env ...string)

func TestBasicFiberv2Https added in v0.4.0

func TestBasicFiberv2Https(t *testing.T, env ...string)

func TestBasicFiberv2Metrics added in v0.8.0

func TestBasicFiberv2Metrics(t *testing.T, env ...string)

func TestBasicGoMicro added in v0.8.0

func TestBasicGoMicro(t *testing.T, env ...string)

func TestBasicGrpc added in v0.0.2

func TestBasicGrpc(t *testing.T, env ...string)

func TestBasicHertz added in v0.0.2

func TestBasicHertz(t *testing.T, env ...string)

func TestBasicHertzWithException added in v0.0.2

func TestBasicHertzWithException(t *testing.T, env ...string)

func TestBasicHertzWithHook added in v0.0.2

func TestBasicHertzWithHook(t *testing.T, env ...string)

func TestBasicHertzWithRegex added in v0.0.2

func TestBasicHertzWithRegex(t *testing.T, env ...string)

func TestBasicMux added in v0.0.2

func TestBasicMux(t *testing.T, env ...string)

func TestBasicNetHttp

func TestBasicNetHttp(t *testing.T, env ...string)

func TestBatch

func TestBatch(t *testing.T, env ...string)

func TestCrudMongo

func TestCrudMongo(t *testing.T, env ...string)

func TestCursor

func TestCursor(t *testing.T, env ...string)

func TestESCrud added in v0.4.0

func TestESCrud(t *testing.T, env ...string)

func TestESMetrics added in v0.8.0

func TestESMetrics(t *testing.T, env ...string)

func TestESTypedClient added in v0.4.0

func TestESTypedClient(t *testing.T, env ...string)

func TestEchoMiddleware added in v0.0.2

func TestEchoMiddleware(t *testing.T, env ...string)

func TestEchoPattern added in v0.0.2

func TestEchoPattern(t *testing.T, env ...string)

func TestEsTypedClientMetrics added in v0.8.0

func TestEsTypedClientMetrics(t *testing.T, env ...string)

func TestExecutingCommands

func TestExecutingCommands(t *testing.T, env ...string)

func TestExecutingUnsupporetedCommands

func TestExecutingUnsupporetedCommands(t *testing.T, env ...string)

func TestGinHTML added in v0.4.0

func TestGinHTML(t *testing.T, env ...string)

func TestGinPattern added in v0.4.0

func TestGinPattern(t *testing.T, env ...string)

func TestGoLog added in v0.3.0

func TestGoLog(t *testing.T, env ...string)

func TestGoRestfulPattern added in v0.6.0

func TestGoRestfulPattern(t *testing.T, env ...string)

func TestGormCrud1220 added in v0.0.2

func TestGormCrud1220(t *testing.T, env ...string)

func TestGormCrud1231 added in v0.0.2

func TestGormCrud1231(t *testing.T, env ...string)

func TestGrpcClientStream added in v0.8.0

func TestGrpcClientStream(t *testing.T, env ...string)

func TestGrpcStatus added in v0.0.2

func TestGrpcStatus(t *testing.T, env ...string)

func TestHttp2

func TestHttp2(t *testing.T, env ...string)

func TestHttpMetric added in v0.3.0

func TestHttpMetric(t *testing.T, env ...string)

func TestHttps

func TestHttps(t *testing.T, env ...string)

func TestIris added in v0.8.0

func TestIris(t *testing.T, env ...string)

func TestKitexBasic added in v0.7.0

func TestKitexBasic(t *testing.T, env ...string)

func TestKitexGrpc added in v0.7.0

func TestKitexGrpc(t *testing.T, env ...string)

func TestKratosGrpc added in v0.3.0

func TestKratosGrpc(t *testing.T, env ...string)

func TestKratosHttp added in v0.3.0

func TestKratosHttp(t *testing.T, env ...string)

func TestLogrus added in v0.0.2

func TestLogrus(t *testing.T, env ...string)

func TestMetrics added in v0.8.0

func TestMetrics(t *testing.T, env ...string)

func TestMetricsEcho added in v0.8.0

func TestMetricsEcho(t *testing.T, env ...string)

func TestMetricsGrpc added in v0.8.0

func TestMetricsGrpc(t *testing.T, env ...string)

func TestMuxMiddleware added in v0.0.2

func TestMuxMiddleware(t *testing.T, env ...string)

func TestMuxPattern added in v0.0.2

func TestMuxPattern(t *testing.T, env ...string)

func TestMuxPrefix added in v0.4.0

func TestMuxPrefix(t *testing.T, env ...string)

func TestMySql5xAccessDatabase

func TestMySql5xAccessDatabase(t *testing.T, env ...string)

func TestMySql5xFetchingDatabase

func TestMySql5xFetchingDatabase(t *testing.T, env ...string)

func TestMySql5xModifyData

func TestMySql5xModifyData(t *testing.T, env ...string)

func TestMySql5xPreparedStatement

func TestMySql5xPreparedStatement(t *testing.T, env ...string)

func TestMySql5xSingleRowQuery

func TestMySql5xSingleRowQuery(t *testing.T, env ...string)

func TestMySql5xTransaction

func TestMySql5xTransaction(t *testing.T, env ...string)

func TestMySql8xAccessDatabase

func TestMySql8xAccessDatabase(t *testing.T, env ...string)

func TestMySql8xFetchingDatabase

func TestMySql8xFetchingDatabase(t *testing.T, env ...string)

func TestMySql8xModifyData

func TestMySql8xModifyData(t *testing.T, env ...string)

func TestNacos200Config added in v0.7.0

func TestNacos200Config(t *testing.T, env ...string)

func TestNacos200Service added in v0.7.0

func TestNacos200Service(t *testing.T, env ...string)

func TestNacos210Config added in v0.7.0

func TestNacos210Config(t *testing.T, env ...string)

func TestNacos210Service added in v0.7.0

func TestNacos210Service(t *testing.T, env ...string)

func TestPreparedStatement

func TestPreparedStatement(t *testing.T, env ...string)

func TestRedigoDoCommands added in v0.4.0

func TestRedigoDoCommands(t *testing.T, env ...string)

func TestRedigoExecutingCommands added in v0.4.0

func TestRedigoExecutingCommands(t *testing.T, env ...string)

func TestRedigoTransactions added in v0.4.0

func TestRedigoTransactions(t *testing.T, env ...string)

func TestRedigoUnsupportedCommands added in v0.4.0

func TestRedigoUnsupportedCommands(t *testing.T, env ...string)

func TestRedisConn

func TestRedisConn(t *testing.T, env ...string)

func TestRedisRing

func TestRedisRing(t *testing.T, env ...string)

func TestRedisTransactions

func TestRedisTransactions(t *testing.T, env ...string)

func TestRedisUniversal

func TestRedisUniversal(t *testing.T, env ...string)

func TestSingleRowQuery

func TestSingleRowQuery(t *testing.T, env ...string)

func TestSpanFromContext added in v0.4.0

func TestSpanFromContext(t *testing.T, env ...string)

func TestTransaction

func TestTransaction(t *testing.T, env ...string)

func TestV8ExecutingCommands added in v0.4.0

func TestV8ExecutingCommands(t *testing.T, env ...string)

func TestV8ExecutingUnsupporetedCommands added in v0.4.0

func TestV8ExecutingUnsupporetedCommands(t *testing.T, env ...string)

func TestV8RedisConn added in v0.4.0

func TestV8RedisConn(t *testing.T, env ...string)

func TestV8RedisRing added in v0.4.0

func TestV8RedisRing(t *testing.T, env ...string)

func TestV8RedisTransactions added in v0.4.0

func TestV8RedisTransactions(t *testing.T, env ...string)

func TestV8RedisUniversal added in v0.4.0

func TestV8RedisUniversal(t *testing.T, env ...string)

func TestZap added in v0.0.2

func TestZap(t *testing.T, env ...string)

func TestZeroLog added in v0.7.0

func TestZeroLog(t *testing.T, env ...string)

func UseApp

func UseApp(appName string)

func UseTestRules added in v0.4.0

func UseTestRules(name string) string

Types

type TestCase

type TestCase struct {
	// TestName is the name of the test case.
	TestName string

	// DependencyName is the name of the dependency being tested.
	DependencyName string

	// ModuleName is the name of the module under test.
	ModuleName string

	// MinVersion is the minimum supported version of the module.
	MinVersion *version.Version

	// MaxVersion is the maximum supported version of the module.
	MaxVersion *version.Version

	// MinGoVersion is the minimum Go version required for the test.
	MinGoVersion *version.Version

	// MaxGoVersion is the maximum Go version supported for the test.
	MaxGoVersion *version.Version

	// TestFunc is the function to run the general test logic.
	TestFunc func(t *testing.T, env ...string)

	// LatestDepthFunc is the function to run the latest depth compatibility test.
	LatestDepthFunc func(t *testing.T, env ...string)

	// MuzzleClasses contains the muzzle classes for the muzzle compatibility check.
	MuzzleClasses []string

	// IsMuzzleCheck indicates if the test case is for muzzle compatibility.
	IsMuzzleCheck bool

	// IsLatestDepthCheck indicates if the test case is for the latest depth check.
	IsLatestDepthCheck bool
}

TestCase represents the configuration and metadata for a test case, including version constraints, test logic, and specific test types.

func NewGeneralTestCase

func NewGeneralTestCase(testName, moduleName, minVersion, maxVersion, minGoVersion, maxGoVersion string, testFunc func(t *testing.T, env ...string)) *TestCase

NewGeneralTestCase creates a general test case to validate module compatibility with specified version constraints and optional test logic.

func NewLatestDepthTestCase

func NewLatestDepthTestCase(testName, dependencyName, moduleName, minVersion, maxVersion, minGoVersion, maxGoVersion string, latestTestFunc func(t *testing.T, env ...string)) *TestCase

NewLatestDepthTestCase creates a test case to validate the compatibility of a module's latest depth with its dependencies.

func NewMuzzleTestCase

func NewMuzzleTestCase(testName, dependencyName, moduleName, minVersion, maxVersion, minGoVersion, maxGoVersion string, muzzleClasses []string) *TestCase

NewMuzzleTestCase creates a test case to validate the muzzle compatibility of a module with its dependencies.

Directories

Path Synopsis
verifier module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳