Closed CoRfr closed 6 years ago
Otherwise in term of testing:
Last build OK:
check-jenkins-job-status.rb -u 'http://jenkins-cnt:8080/' --jobs '^Legato-Review'
JenkinsJobChecker OK: All queried jobs report success
Build in progress, last build not OK:
check-jenkins-job-status.rb -u 'http://jenkins-cnt:8080/' --jobs '^Mdm9x28-Review'
JenkinsJobChecker CRITICAL: Jobs reporting failure: Mdm9x28-Review, jobs reported as unstable:
Build finished and not OK:
docker exec -ti sensu-client check-jenkins-job-status.rb -u 'http://jenkins-cnt:8080/' --jobs '^Mdm9x15-GenerateManifest'
JenkinsJobChecker CRITICAL: Jobs reporting failure: Mdm9x15-GenerateManifest, jobs reported as unstable:
Sorry this got lost in the sea of github notifications. Will review latest comments and code shortly.
When checking the status of a build, and it is in a 'running' state, it would check the previous build. However there is not guarantee that this build is not running as well, which results in a build['result'] that is nil, and an exception.
This uses the 'lastCompletedBuild' alias to get the last completed build, since we are sure that this one is not running.
Pull Request Checklist
Is this in reference to an existing issue?
General
[x] Update Changelog following the conventions laid out on Our CHANGELOG Guidelines
[x] Update README with any necessary configuration snippets
[x] Binstubs are created if needed
[x] RuboCop passes
[x] Existing tests pass
New Plugins
[ ] Tests
[ ] Add the plugin to the README
[ ] Does it have a complete header as outlined here
Purpose
Known Compatibility Issues