Skip to content

Commit

Permalink
When measuring the number of job runs within a time period with Jenki…
Browse files Browse the repository at this point in the history
…ns as source, don't throw an exception when a Jenkins pipeline build has no result yet.

Fixes #10610.
  • Loading branch information
fniessink committed Jan 14, 2025
1 parent 8fe6c75 commit 563829f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def _include_build(self, build: Build) -> bool:
result_types = [result_type.lower() for result_type in self._parameter("result_type")]
lookback_days = int(cast(str, self._parameter("lookback_days")))
build_datetime = datetime_from_timestamp(int(build["timestamp"]))
return days_ago(build_datetime) <= lookback_days and build["result"].lower() in result_types
return days_ago(build_datetime) <= lookback_days and build.get("result", "").lower() in result_types
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def setUp(self):
self.builds = [
{"result": "FAILURE", "timestamp": 1552686540953},
{"result": "SUCCESS", "timestamp": 1552686531953},
{"timestamp": 1552686531953},
]
self.job_url = "https://job"
self.job2_url = "https://job2"
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ async function clickDownload(nrClicks = 1) {
}

function expectButtonIsLoading() {
expect(screen.getAllByLabelText(/Download/)[0].className).toContain("MuiCircularProgress-indeterminate")
expect(screen.getByRole("button").className).toContain("MuiLoadingButton-loading")
}

function expectButtonIsNotLoading() {
expect(screen.getByLabelText(/Download/).className).not.toContain("MuiCircularProgress-indeterminate")
expect(screen.getByRole("button").className).not.toContain("MuiLoadingButton-loading")
}

function mockGetReportPDFWithTimeout() {
Expand Down
1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ If your currently installed *Quality-time* version is not the latest version, pl
### Fixed

- Don't throw an exception when a Trivy JSON file contains vulnerabilities without fixed version information. Fixes [#10606](https://github.com/ICTU/quality-time/issues/10606).
- When measuring the number of job runs within a time period with Jenkins as source, don't throw an exception when a Jenkins pipeline build has no result yet. Fixes [#10610](https://github.com/ICTU/quality-time/issues/10610).

### Added

Expand Down

0 comments on commit 563829f

Please sign in to comment.