@@ -225,7 +225,7 @@ func (s *Stage) run(ctx context.Context) (returnErr error) {
225
225
s .prepareClient ()
226
226
s .propagateStates ()
227
227
if len (s .Queries )+ len (s .QueryFiles ) > 0 {
228
- if s . RandomExecution != nil && * s .RandomExecution {
228
+ if * s .RandomExecution {
229
229
returnErr = s .runRandomly (ctx )
230
230
} else {
231
231
returnErr = s .runSequentially (ctx )
@@ -271,7 +271,7 @@ func (s *Stage) runSequentially(ctx context.Context) (returnErr error) {
271
271
}
272
272
273
273
func (s * Stage ) runQueryFile (ctx context.Context , queryFile string , expectedRowCountStartIndex * int , fileAlias * string ) error {
274
- file , err := os . Open ( queryFile )
274
+ // fileAlias is the query file name we will report. We try to make it short, so try to use relative path when possible.
275
275
if fileAlias == nil {
276
276
if relPath , relErr := filepath .Rel (s .BaseDir , queryFile ); relErr == nil {
277
277
fileAlias = & relPath
@@ -280,6 +280,7 @@ func (s *Stage) runQueryFile(ctx context.Context, queryFile string, expectedRowC
280
280
}
281
281
}
282
282
283
+ file , err := os .Open (queryFile )
283
284
var queries []string
284
285
if err == nil {
285
286
queries , err = presto .SplitQueries (file )
@@ -320,7 +321,7 @@ func (s *Stage) runRandomly(ctx context.Context) error {
320
321
} else {
321
322
err := fmt .Errorf ("failed to parse randomly_execute_until %s" , * s .RandomlyExecuteUntil )
322
323
if * s .AbortOnError {
323
- s .States .exitCode .CompareAndSwap (0 , 5 )
324
+ s .States .exitCode .CompareAndSwap (0 , 2 ) // syntax error
324
325
return err
325
326
} else {
326
327
log .Error ().Err (err ).Send ()
0 commit comments