execHelper

package
v0.0.0-...-a97389e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyRunning = "isRunning"
)
View Source
const (
	Tmpl = `` /* 287-byte string literal not displayed */

)

Variables

View Source
var (
	OptionsMap = map[string]string{}
)
View Source
var (
	SyncMap sync.Map
)

Functions

func AddInterpreterIfExist

func AddInterpreterIfExist(conf *commDomain.WorkspaceConf, lang string) bool

func CheckCaseResult

func CheckCaseResult(execParams commDomain.ExecParams, logs string, wsMsg *websocket.Message, errOutput string, lock *sync.Mutex)

func Compare

func Compare(expect string, actual string) bool

func CompareFloat

func CompareFloat(actualFloat, expectFloat float64, symbol string) bool

func CompareRange

func CompareRange(expect string, actual string) bool

func Contain

func Contain(expect, actual string, langType string) bool

func ConvertAllureResult

func ConvertAllureResult(cases []commDomain.AllureCase) (testSuites []commDomain.UnitTestSuite)

func ConvertCppUnitResult

func ConvertCppUnitResult(cppunitSuite commDomain.CppUnitSuites) commDomain.UnitTestSuite

func ConvertGTestResult

func ConvertGTestResult(gTestSuite commDomain.GTestSuites) commDomain.UnitTestSuite

func ConvertJestResult

func ConvertJestResult(jestSuite commDomain.JestSuites) commDomain.UnitTestSuite

func ConvertK6Result

func ConvertK6Result(results []interface{}, failedCaseIdToThresholdMap map[string]string) commDomain.UnitTestSuite

func ConvertPhpUnitResult

func ConvertPhpUnitResult(phpUnitSuite commDomain.PhpUnitSuites) commDomain.UnitTestSuite

func ConvertPyTestResult

func ConvertPyTestResult(pytestSuites commDomain.PyTestSuites) commDomain.UnitTestSuite

func ConvertQTestResult

func ConvertQTestResult(qTestSuite commDomain.QTestSuites) commDomain.UnitTestSuite

func ConvertRobotResult

func ConvertRobotResult(result commDomain.RobotResult) commDomain.UnitTestSuite

func ExeScripts

func ExeScripts(execParams commDomain.ExecParams, ch chan int, wsMsg *websocket.Message)

func Exec

func Exec(ch chan int, req serverDomain.ExecReq, msg *websocket.Message) (
	err error)

func ExecCases

func ExecCases(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (report commDomain.ZtfReport, pathMaxWidth int, err error)

func ExecModule

func ExecModule(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (
	report commDomain.ZtfReport, pathMaxWidth int, err error)

func ExecScan

func ExecScan() (report *commDomain.ZapReport, err error)

func ExecScript

func ExecScript(execParams commDomain.ExecParams, ch chan int, wsMsg *websocket.Message, lock *sync.Mutex)

func ExecSuite

func ExecSuite(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (
	report commDomain.ZtfReport, pathMaxWidth int, err error)

func ExecTask

func ExecTask(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (
	report commDomain.ZtfReport, pathMaxWidth int, err error)

func ExecUnit

func ExecUnit(ch chan int, req serverDomain.TestSet, wsMsg *websocket.Message) (err error)

func ExecZapScan

func ExecZapScan(req serverDomain.TestSet) (err error)

func ExpandCaseForMultiIds

func ExpandCaseForMultiIds(suites *[]commDomain.UnitTestSuite)

func FilterCases

func FilterCases(cases []string, conf *commDomain.WorkspaceConf) (casesToRun, casesToIgnore []string)

func GenJacocoCovReport

func GenJacocoCovReport() (report *commDomain.JacocoResult)

func GenRunResult

func GenRunResult(report commDomain.ZtfReport) (result, resultClient, resultLog string)

func GenStatusTxt

func GenStatusTxt(status commConsts.ResultStatus) (colorTxt string, txt string)

func GenUnitReport

func GenUnitReport(cases []commDomain.UnitResult, report *commDomain.ZtfReport, duration float32) (failedCaseLines, failedCaseLinesDesc []string)

func GenUnitTestReport

func GenUnitTestReport(req serverDomain.TestSet, startTime, endTime int64, ch chan int, wsMsg *websocket.Message) (
	report commDomain.ZtfReport)

func GenZTFReport

func GenZTFReport(report commDomain.ZtfReport) (failedCount int, failedCaseLinesWithCheckpoint []string)

func GenZTFTestReport

func GenZTFTestReport(report commDomain.ZtfReport, pathMaxWidth int,
	workspacePath string, ch chan int, wsMsg *websocket.Message)

func GetAllureCaseId

func GetAllureCaseId(cs commDomain.AllureCase) (ids string)

func GetAllureCaseSuiteName

func GetAllureCaseSuiteName(cs commDomain.AllureCase) (name string)

func GetAllureSuites

func GetAllureSuites(resultDir string, startTime int64) (suites []commDomain.UnitTestSuite)

func GetK6FailCaseInSummary

func GetK6FailCaseInSummary(content string) (ret map[string]string)

func GetLangInterpreter

func GetLangInterpreter(language string) (list []map[string]interface{}, err error)

func GetLangInterpreterUnix

func GetLangInterpreterUnix(language string) (list []map[string]interface{}, err error)

func GetLangInterpreterWin

func GetLangInterpreterWin(language string) (list []map[string]interface{}, err error)

func GetNoEmptyLines

func GetNoEmptyLines(text, find string, getOne bool) (ret []string)

func GetRunning

func GetRunning() (val bool)

func GetSuiteFiles

func GetSuiteFiles(resultDir string, startTime int64, testTool commConsts.TestTool) (resultFiles []string, err error)

func GetTestSuite

func GetTestSuite(logFile string, testTool commConsts.TestTool, failedCaseIdToThresholdMap map[string]string) (
	testSuite commDomain.UnitTestSuite, err error)

func InitZap

func InitZap(req serverDomain.TestSet)

func KillProcessByUUID

func KillProcessByUUID(uuid string)

func Logic

func Logic(expect, actual, langType string) bool

func Match

func Match(expect string, actual string) bool

func MatchScene

func MatchScene(expect, actual, langType string) (pass bool)

func ParserUnitTestResult

func ParserUnitTestResult(testSuites []commDomain.UnitTestSuite) (
	cases []commDomain.UnitResult, classNameMaxWidth int, dur float32)

func PopulateTestSetPropsWithParentRequest

func PopulateTestSetPropsWithParentRequest(req *serverDomain.ExecReq)

func PrintErrMsg

func PrintErrMsg(key string, err error, wsMsg *websocket.Message) (
	stdOutput string, errOutput string)

func RetrieveRobotTests

func RetrieveRobotTests(suite commDomain.RobotSuite, tests *[]commDomain.RobotTest)

func RetrieveUnitResult

func RetrieveUnitResult(testset serverDomain.TestSet, startTime int64) (
	suites []commDomain.UnitTestSuite)

func RunFile

func RunFile(filePath, workspacePath string, conf commDomain.WorkspaceConf,
	ch chan int, wsMsg *websocket.Message, idx int) (
	stdOutput string, errOutput string)

func RunUnitTest

func RunUnitTest(ch chan int, cmdStr, workspacePath string, wsMsg *websocket.Message) (err error)

func RunZtf

func RunZtf(ch chan int,
	workspacePath string, productId, id int, by commConsts.ExecBy, cases []string, wsMsg *websocket.Message) (
	report commDomain.ZtfReport, pathMaxWidth int, err error)

func SetRunning

func SetRunning(val bool)

func SetRunningIfNeed

func SetRunningIfNeed(ch chan int)

func ValidateCaseResult

func ValidateCaseResult(execParams commDomain.ExecParams, langType string,
	steps []commDomain.ZentaoCaseStep, skip bool, actualArr [][]string,
	wsMsg *websocket.Message, errOutput string, lock *sync.Mutex)

func ValidateStepResult

func ValidateStepResult(langType string, expectLines []string, actualLines []string) (
	stepResult commConsts.ResultStatus, checkpointLogs []commDomain.CheckPointLog)

func ZipDir

func ZipDir(req serverDomain.TestSet)

Types

type ZapScanResp

type ZapScanResp struct {
	ScanId string `json:"scan"`
}

type ZapScanStatus

type ZapScanStatus struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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