Improve logging of Jenkins jobs

- fix unit test
This commit is contained in:
Tomasz Sęk 2019-06-18 20:16:10 +02:00
parent 98110fac91
commit 13efd245f9
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
1 changed files with 13 additions and 0 deletions

View File

@ -316,6 +316,19 @@ func TestEnsureJobFailedWithMaxRetries(t *testing.T) {
}, nil)
}
// fifth run - build should be unrecoverable failed and status updated
if reconcileAttempt == 5 {
jenkinsClient.
EXPECT().
GetBuild(buildName, int64(2)).
Return(&gojenkins.Build{
Raw: &gojenkins.BuildResponse{
Result: string(v1alpha2.BuildFailureStatus),
},
Jenkins: gojenkins.CreateJenkins(nil, ""),
}, nil)
}
done, errEnsureBuildJob := jobs.EnsureBuildJob(buildName, encodedHash, nil, jenkins, true)
assert.NoError(t, err)