Atlas › Test

TotalTimeoutInvalid

Exact test identity: go.temporal.io/server/tools/testrunner/TestRunnerSanitizeAndParseArgs/TotalTimeoutInvalid

Package
go.temporal.io/server/tools/testrunner
Suite / test hierarchy
TestRunnerSanitizeAndParseArgs/TotalTimeoutInvalid
Test
TotalTimeoutInvalid
Introduced at
testrunner.go ×1 Frontier kind: Joint frontier
Covered ranges
15
Covered lines
28
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/tools/testrunner/testrunner.go 28 covered LOC · 15 ranges

Open complete file

81 }
82
83 > func newRunner() *runner { testrunner.go
84 > return &runner{
85 > attempts: make([]*attempt, 0),
86 > maxAttempts: 1,
87 > }
88 > }
89
90 // nolint:revive,cognitive-complexity
91 > func (r *runner) sanitizeAndParseArgs(command string, args []string) ([]string, error) { testrunner.go
92 > var sanitizedArgs []string
93 > for _, arg := range args {
94 > if strings.HasPrefix(arg, maxAttemptsFlag) { testrunner.go
95 var err error
96 r.maxAttempts, err = strconv.Atoi(strings.Split(arg, "=")[1])
104 }
105
106 > if strings.HasPrefix(arg, totalTimeoutFlag) { testrunner.go
107 > var err error testrunner.go
108 > r.totalTimeout, err = time.ParseDuration(strings.TrimPrefix(arg, totalTimeoutFlag))
109 > if err != nil {
110 > return nil, fmt.Errorf("invalid argument %q: %w", totalTimeoutFlag, err) testrunner.go
111 > }
112 if r.totalTimeout == 0 {
113 return nil, fmt.Errorf("invalid argument %q: must be greater than zero", totalTimeoutFlag)
116 }
117
118 > if strings.HasPrefix(arg, gotestsumPathFlag) { testrunner.go
119 > r.gotestsumPath = strings.Split(arg, "=")[1] testrunner.go
120 > continue
121 }
122
123 > if strings.HasPrefix(arg, crashReportNameFlag) { testrunner.go
124 r.crashName = strings.Split(arg, "=")[1]
125 if r.crashName == "" {
132 }
133
134 > if strings.HasPrefix(arg, junitGlobFlag) { testrunner.go
135 r.junitGlob = strings.Split(arg, "=")[1]
136 continue
137 }
138 > if strings.HasPrefix(arg, summaryOutputDirFlag) { testrunner.go
139 r.summaryOutputDir = strings.Split(arg, "=")[1]
140 if command != summaryCommand {
143 continue
144 }
145 > if strings.HasPrefix(arg, coverProfileFlag) { testrunner.go
146 r.coverProfilePath = strings.Split(arg, "=")[1]
147 > } else if strings.HasPrefix(arg, junitReportFlag) { testrunner.go
148 > // --junitfile is used by gotestsum testrunner.go
149 > r.junitOutputPath = strings.Split(arg, "=")[1]
150 > }
151
152 > sanitizedArgs = append(sanitizedArgs, arg) testrunner.go
153 }
154