Skip to content

Commit

Permalink
test(core): demonstrate current behavior of JobExecutorLocal with emp…
Browse files Browse the repository at this point in the history
…ty output

This test currently fails.  The next commit fixes it.
  • Loading branch information
dbyron-sf committed Jan 23, 2025
1 parent 2a1d914 commit 61380d1
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,29 @@ Final output
true | COMBINED_OUTPUT | COMBINED_OUTPUT
false | EXPECTED_OUTPUT | EXPECTED_LOGS
}

void 'job executor handles empty output'() {
def jobRequest = new JobRequest(
tokenizedCommand: ["true"],
jobId: SOME_JOB_ID,
combineStdOutAndErr: false)

@Subject
def jobExecutorLocal = new JobExecutorLocal(
registry: new DefaultRegistry(),
timeoutMinutes: 1)

when:
def jobId = jobExecutorLocal.startJob(jobRequest)
// Give the script time to run + 100 ms fudge factor
sleep(3000)
def bakeStatus = jobExecutorLocal.updateJob(jobId)

then:
bakeStatus != null
bakeStatus.state == BakeStatus.State.COMPLETED
bakeStatus.result == BakeStatus.Result.SUCCESS
bakeStatus.outputContent == ""
bakeStatus.logsContent == "No output from command."
}
}

0 comments on commit 61380d1

Please sign in to comment.