[DPP-1144] Do not fail when benchtool-tests package is not found by Benchtool (#15455)

changelog_begin
changelog_end
This commit is contained in:
pbatko-da 2022-11-07 11:05:11 +01:00 committed by GitHub
parent 2d2f645fdd
commit 3d83948cdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,10 +78,13 @@ object SubmittedDataAnalyzing {
if (candidatesPackageIds.size > 1) {
logger.warn(s"Found more than one Daml package with name '$BenchtoolTestsPackageName'")
}
val packageId = candidatesPackageIds.headOption.getOrElse(
sys.error(s"Could not find a Daml package with name '$BenchtoolTestsPackageName'")
val detectedPackageInfoO = candidatesPackageIds.headOption.map(BenchtoolTestsPackageInfo(_))
detectedPackageInfoO.getOrElse {
logger.info(
s"Could not find a Daml package with name '$BenchtoolTestsPackageName'; defaulting its packageId to the static one"
)
BenchtoolTestsPackageInfo(packageId = packageId)
BenchtoolTestsPackageInfo.StaticDefault
}
}
}