Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func isAllowed(s *Scenario) bool {

func doScenario(in *doScenarioInput) error {
for _, f := range in.ScenarioFiles {
if in.app != nil && in.RunID != "" && in.app.isRunCancelled(in.RunID) {
log.Printf("doScenario: run_id=%s is cancelled, stopping at %s", in.RunID, f)
return nil
}

yml, err := os.ReadFile(f)
if err != nil {
continue
Expand Down Expand Up @@ -232,6 +237,11 @@ func doScenario(in *doScenarioInput) error {
}

for i, run := range s.Run {
if in.app != nil && in.RunID != "" && in.app.isRunCancelled(in.RunID) {
log.Printf("doScenario: run_id=%s cancelled mid-run at step %d of %s", in.RunID, i, f)
return nil
}

basef := filepath.Base(f)
prefix := filepath.Join(os.TempDir(), fmt.Sprintf("%v_run%d", basef, i))

Expand Down