Ask the Jenkins agent why a build failed. It finds the failed builds of a work item or a job, looks at the job’s recent builds, and compares the failing build with the last build that passed.
Ask for example:
- Why did the latest Jenkins build for this work item fail?
- Since when is the
payment-servicejob failing? - What changed compared to the last good build of JJI-123?
The answer
For each failed job, the agent starts with a one-line verdict, for example:
payment-service#142 is unstable: 3 tests fail. It has failed since #139; #138 was the last good build.
Then it gives the details:
- Failing since: the first build of the current run of failed or unstable builds, and how many builds failed in a row. When all recent builds failed, it says that the failures started before the builds it can see.
- Cause: what started the first failing build, for example an SCM change, a timer or a user.
- Tests: the test counts of the failing build compared with the last good build: new failures, and tests that were added or no longer run.
- Duration: a build that ran much shorter than the last good build often stopped before its tests ran.
- Links to the failing build and the last good build in Jenkins.
When more than three jobs failed, the agent triages the three that failed most recently and names the others.
Limits
- The agent looks back at up to 20 builds per job. Ask it to look further back if you need to.
- The app keeps a summary of every build, not its console log, failing test names, commits, branches or the node it ran on. The agent doesn’t guess the error; the console log in Jenkins shows it.
Previous: Start Jenkins Builds
Next: Deployments of a Work Item