Skip to content

Commit dc9bbad

Browse files
committed
Fix unit tests
1 parent 421633a commit dc9bbad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (d *Driver) runMapPhase(job *Job, jobNumber int, inputs []string) {
131131
inputSplits := job.inputSplits(inputs, d.config.SplitSize)
132132
if len(inputSplits) == 0 {
133133
log.Warnf("No input splits")
134-
os.Exit(0)
134+
return
135135
}
136136
log.Debugf("Number of job input splits: %d", len(inputSplits))
137137

@@ -188,7 +188,7 @@ func (d *Driver) run() {
188188

189189
if len(d.config.Inputs) == 0 {
190190
log.Error("No inputs!")
191-
os.Exit(1)
191+
return
192192
}
193193

194194
inputs := d.config.Inputs

lambda_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ func TestHandleRequest(t *testing.T) {
4040
WorkingLocation: ".",
4141
}
4242

43-
job := &Job{}
43+
job := &Job{
44+
config: &config{},
45+
}
4446

4547
// These values should be reset to 0 by Lambda handler function
4648
job.bytesRead = 10

0 commit comments

Comments
 (0)