Documentation ¶
Index ¶
- Constants
- Variables
- func AddHttpBodyToMap(body string, m map[string][]string) error
- func ArrayToMap(arr []string) map[string]bool
- func CheckStringExist(s string, mp map[string][]string) ([]string, bool)
- func CompareHeaders(h1 http.Header, h2 http.Header, res *[]models.HeaderResult, ...) bool
- func Contains(elems []string, v string) bool
- func FilterTcsMocks(tc *models.TestCase, m []*models.Mock, logger *zap.Logger) []*models.Mock
- func Flatten(j interface{}) map[string][]string
- func FlattenHttpResponse(h http.Header, body string) (map[string][]string, error)
- func InterfaceToString(val interface{}) string
- func LeftJoinNoise(globalNoise models.GlobalNoise, tsNoise models.GlobalNoise) models.GlobalNoise
- func MapToArray(mp map[string][]string) []string
- func Match(exp, act string, noise map[string][]string, log *zap.Logger) (string, string, bool, error)
- func MatchesAnyRegex(str string, regexArray []string) (bool, string)
- func UnmarshallJson(s string, log *zap.Logger) (interface{}, error)
- type DiffsPrinter
- type FetchTestResultsConfig
- type InitialiseRunTestSetReturn
- type InitialiseTestReturn
- type RunTestSetConfig
- type SimulateRequestConfig
- type TestConfig
- type TestOptions
- type Tester
Constants ¶
View Source
const MAX_LINE_LENGTH = 50
Chars PER expected/actual string. Can be changed no problem
Variables ¶
View Source
var Emoji = "\U0001F430" + " Keploy:"
Functions ¶
func ArrayToMap ¶
func CompareHeaders ¶
func FilterTcsMocks ¶
Filter the mocks based on req and res timestamp of test
func Flatten ¶
Flatten takes a map and returns a new one where nested maps are replaced by dot-delimited keys. examples of valid jsons - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#examples
func FlattenHttpResponse ¶
func InterfaceToString ¶
func InterfaceToString(val interface{}) string
func LeftJoinNoise ¶
func LeftJoinNoise(globalNoise models.GlobalNoise, tsNoise models.GlobalNoise) models.GlobalNoise
func MapToArray ¶
Types ¶
type DiffsPrinter ¶
type DiffsPrinter struct {
// contains filtered or unexported fields
}
func NewDiffsPrinter ¶
func NewDiffsPrinter(testCase string) DiffsPrinter
func (*DiffsPrinter) PushBodyDiff ¶
func (d *DiffsPrinter) PushBodyDiff(exp, act string, noise map[string][]string)
func (*DiffsPrinter) PushHeaderDiff ¶
func (d *DiffsPrinter) PushHeaderDiff(exp, act, key string, noise map[string][]string)
func (*DiffsPrinter) PushStatusDiff ¶
func (d *DiffsPrinter) PushStatusDiff(exp, act string)
func (*DiffsPrinter) Render ¶
func (d *DiffsPrinter) Render()
Will display and colorize diffs side-by-side
type FetchTestResultsConfig ¶
type FetchTestResultsConfig struct { TestReportFS platform.TestReportDB TestReport *models.TestReport Status *models.TestRunStatus TestSet string Success *int Failure *int Ctx context.Context TestReportPath string Path string }
type InitialiseTestReturn ¶
type RunTestSetConfig ¶
type RunTestSetConfig struct { TestSet string Path string TestReportPath string AppCmd string AppContainer string AppNetwork string Delay uint64 BuildDelay time.Duration Pid uint32 YamlStore platform.TestCaseDB LoadedHooks *hooks.Hook TestReportFS platform.TestReportDB TestRunChan chan string ApiTimeout uint64 Ctx context.Context ServeTest bool }
type SimulateRequestConfig ¶
type SimulateRequestConfig struct { Tc *models.TestCase LoadedHooks *hooks.Hook AppCmd string UserIP string TestSet string ApiTimeout uint64 Success *int Failure *int Status *models.TestRunStatus TestReportFS platform.TestReportDB TestReport *models.TestReport Path string DockerID bool NoiseConfig models.GlobalNoise }
type TestConfig ¶
type TestOptions ¶
type TestOptions struct { MongoPassword string Delay uint64 BuildDelay time.Duration PassThroughPorts []uint ApiTimeout uint64 Tests map[string][]string AppContainer string AppNetwork string ProxyPort uint32 GlobalNoise models.GlobalNoise TestsetNoise models.TestsetNoise WithCoverage bool CoverageReportPath string }
type Tester ¶
type Tester interface { Test(path string, testReportPath string, appCmd string, options TestOptions, enableTele bool) bool RunTestSet(testSet, path, testReportPath, appCmd, appContainer, appNetwork string, delay uint64, buildDelay time.Duration, pid uint32, ys platform.TestCaseDB, loadedHook *hooks.Hook, testReportfs platform.TestReportDB, testRunChan chan string, apiTimeout uint64, ctx context.Context, testcases map[string]bool, noiseConfig models.GlobalNoise, serveTest bool) models.TestRunStatus InitialiseTest(cfg *TestConfig) (InitialiseTestReturn, error) InitialiseRunTestSet(cfg *RunTestSetConfig) InitialiseRunTestSetReturn SimulateRequest(cfg *SimulateRequestConfig) FetchTestResults(cfg *FetchTestResultsConfig) models.TestRunStatus }
Click to show internal directories.
Click to hide internal directories.