From 1cf196763baa84d21c3ced3267bd6f913229611a Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Tue, 12 May 2026 15:53:12 +0200 Subject: [PATCH 1/3] Don't wrap unexpected exceptions in FidoMetadataDownloaderIntegrationTest The `Try` wrapping obscures the exception stack when there's an unexpected exception, so you'd have to use a debugger to inspect the wrapped exception and its cause(s). This wrapping is unnecessary since we can just let the exception propagate and be caught as a test failure with the full exception stack intact. --- .../FidoMetadataDownloaderIntegrationTest.scala | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/webauthn-server-attestation/src/integrationTest/scala/com/yubico/fido/metadata/FidoMetadataDownloaderIntegrationTest.scala b/webauthn-server-attestation/src/integrationTest/scala/com/yubico/fido/metadata/FidoMetadataDownloaderIntegrationTest.scala index 6973fa40f..709efe57d 100644 --- a/webauthn-server-attestation/src/integrationTest/scala/com/yubico/fido/metadata/FidoMetadataDownloaderIntegrationTest.scala +++ b/webauthn-server-attestation/src/integrationTest/scala/com/yubico/fido/metadata/FidoMetadataDownloaderIntegrationTest.scala @@ -13,8 +13,6 @@ import org.scalatest.tags.Slow import org.scalatestplus.junit.JUnitRunner import scala.jdk.CollectionConverters.ListHasAsScala -import scala.util.Success -import scala.util.Try @Slow @Network @@ -28,16 +26,15 @@ class FidoMetadataDownloaderIntegrationTest val downloader = cachedDefaultSettingsDownloader.build() it("downloads and verifies the root cert and BLOB successfully.") { - val blob = Try(TestCaches.cacheSynchronized(downloader.loadCachedBlob)) - blob shouldBe a[Success[_]] - blob.get should not be null + val blob = TestCaches.cacheSynchronized(downloader.loadCachedBlob) + blob should not be null } it( "does not encounter any CRLDistributionPoints entries in unknown format." ) { - val blob = Try(TestCaches.cacheSynchronized(downloader.loadCachedBlob)) - blob shouldBe a[Success[_]] + val blob = TestCaches.cacheSynchronized(downloader.loadCachedBlob) + blob should not be null val trustRootCert = CertificateParser.parseDer( TestCaches.trustRootCache.get.getBytes @@ -86,9 +83,8 @@ class FidoMetadataDownloaderIntegrationTest .build() it("downloads and parses the BLOB successfully.") { - val blob = Try(TestCaches.cacheSynchronized(downloader.loadCachedBlob)) - blob shouldBe a[Success[_]] - blob.get should not be null + val blob = TestCaches.cacheSynchronized(downloader.loadCachedBlob) + blob should not be null } } From a81cbabea7530e1da68caf0e696629c445202616 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Tue, 12 May 2026 16:15:53 +0200 Subject: [PATCH 2/3] Also create parent directories of integration test FIDO_MDS_CACHE_DIR --- webauthn-server-attestation/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webauthn-server-attestation/build.gradle.kts b/webauthn-server-attestation/build.gradle.kts index 8043777de..cad391174 100644 --- a/webauthn-server-attestation/build.gradle.kts +++ b/webauthn-server-attestation/build.gradle.kts @@ -62,7 +62,7 @@ val integrationTest = task("integrationTest") { classpath = sourceSets["integrationTest"].runtimeClasspath shouldRunAfter(tasks.test) val mdsCacheDir = project.layout.buildDirectory.dir("fido-mds-cache").get().asFile - mdsCacheDir.mkdir() + mdsCacheDir.mkdirs() environment("FIDO_MDS_CACHE_DIR", mdsCacheDir.absolutePath) } tasks["check"].dependsOn(integrationTest) From b2b1b18aa540dfe527f390775fbe7f1dc42ef5b5 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Tue, 12 May 2026 16:16:17 +0200 Subject: [PATCH 3/3] Declare FIDO_MDS_CACHE_DIR as input dependency of integrationTest task --- webauthn-server-attestation/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/webauthn-server-attestation/build.gradle.kts b/webauthn-server-attestation/build.gradle.kts index cad391174..94f5a34a4 100644 --- a/webauthn-server-attestation/build.gradle.kts +++ b/webauthn-server-attestation/build.gradle.kts @@ -64,6 +64,7 @@ val integrationTest = task("integrationTest") { val mdsCacheDir = project.layout.buildDirectory.dir("fido-mds-cache").get().asFile mdsCacheDir.mkdirs() environment("FIDO_MDS_CACHE_DIR", mdsCacheDir.absolutePath) + inputs.dir(mdsCacheDir) } tasks["check"].dependsOn(integrationTest)