diff --git a/release_notes.md b/release_notes.md index 723ffee7ab..824629aaaa 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,6 @@ ## v4.4.0 (unreleased) +- [#501](https://github.com/TestArmada/flank/pull/501) Fix nullability check in SavedMatrix. ([bootstraponline](https://github.com/bootstraponline)) - [#493](https://github.com/TestArmada/flank/pull/493) Fix getDefaultBucket timeout. ([bootstraponline](https://github.com/bootstraponline)) ## v4.3.1 diff --git a/test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt b/test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt index 23aa618ace..9e640f0511 100644 --- a/test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt +++ b/test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt @@ -77,8 +77,11 @@ class SavedMatrix(matrix: TestMatrix) { val step = GcToolResults.getResults(it.toolResultsStep) updateOutcome(step.outcome) - if (step.testExecutionStep == null) return - val billableMinutes = Billing.billableMinutes(step.testExecutionStep.testTiming.testProcessDuration.seconds) + // testExecutionStep, testTiming, etc. can all be null. + // sometimes testExecutionStep is present and testTiming is null + val testTimeSeconds = step.testExecutionStep?.testTiming?.testProcessDuration?.seconds ?: return + + val billableMinutes = Billing.billableMinutes(testTimeSeconds) if (AndroidCatalog.isVirtualDevice(it.environment?.androidDevice)) { billableVirtualMinutes += billableMinutes diff --git a/test_runner/src/test/kotlin/ftl/test/util/TestArtifact.kt b/test_runner/src/test/kotlin/ftl/test/util/TestArtifact.kt index cec2a6207f..98e9533254 100644 --- a/test_runner/src/test/kotlin/ftl/test/util/TestArtifact.kt +++ b/test_runner/src/test/kotlin/ftl/test/util/TestArtifact.kt @@ -74,9 +74,11 @@ object TestArtifact { private fun remoteAssetLink(): Element { val doc = getHtml() - val downloadLinks = doc.select("li.d-block > a") + val downloadLinks = doc.select("a") + // /Flank/test_artifacts/releases/download/latest/2552E672A1366D1B3A06452AA7256ABC.zip + val zipRegex = Regex(".*releases/download/latest/\\H{32}\\.zip$") return downloadLinks.find { - it.attr("href").endsWith(".zip") && it.attr("href").contains("releases/download") + it.attr("href").matches(zipRegex) } ?: throw RuntimeException("Download link not found in html!") }