From d61e20e4dead67028dc5d8717e669078a5122ccc Mon Sep 17 00:00:00 2001 From: IgnatBeresnev Date: Thu, 26 Jan 2023 05:09:22 +0100 Subject: [PATCH 1/2] Disable caching of Dokka's integration tests Because integration tests are cached by default, it produces no output for showcasing documentation through S3 or GitHub artifacts. Regression from #2711 --- integration-tests/build.gradle.kts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 45e1609766..826604710d 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -21,7 +21,26 @@ subprojects { implementation(project(":integration-tests")) } - val integrationTest by tasks.register("integrationTest") { + /** + * Dokka's integration test task is not cacheable because the HTML outputs + * it produces when running the tests are used for showcasing resulting documentation. + * + * At the moment there are two problems that do not allow to make it cacheable: + * 1. The task's inputs are such that changes in Dokka's code do not invalidate the cache, + * because it is run with the same version of Dokka ("DOKKA_VERSION") on the same + * test project inputs. + * 2. The tests generate HTML output which is then used to showcase documentation. + * The outputs are usually copied to a location from which it will be served. + * However, if the test is cacheable, it produces no outputs, so no documentation + * to showcase. It needs to be broken into two separate tasks: one cacheable for running + * the tests and producing HTML output, and another non-cacheable for copying the output. + * + * @see [org.jetbrains.dokka.it.TestOutputCopier] for more details on showcasing documentation + */ + @DisableCachingByDefault + abstract class NonCacheableIntegrationTest : Test() + + val integrationTest by tasks.register("integrationTest") { maxHeapSize = "2G" description = "Runs integration tests." group = "verification" From d6d14c741418c9eb95fb0897054bc141fe790aad Mon Sep 17 00:00:00 2001 From: IgnatBeresnev Date: Wed, 8 Feb 2023 01:10:33 +0100 Subject: [PATCH 2/2] Add a short description to `DisableCachingByDefault` --- integration-tests/build.gradle.kts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 826604710d..226b4b6f4c 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -23,9 +23,11 @@ subprojects { /** * Dokka's integration test task is not cacheable because the HTML outputs - * it produces when running the tests are used for showcasing resulting documentation. + * it produces when running the tests are used for showcasing resulting documentation, + * which does not work well with caching. * * At the moment there are two problems that do not allow to make it cacheable: + * * 1. The task's inputs are such that changes in Dokka's code do not invalidate the cache, * because it is run with the same version of Dokka ("DOKKA_VERSION") on the same * test project inputs. @@ -37,7 +39,7 @@ subprojects { * * @see [org.jetbrains.dokka.it.TestOutputCopier] for more details on showcasing documentation */ - @DisableCachingByDefault + @DisableCachingByDefault(because = "Contains incorrect inputs/outputs configuration, see the KDoc for details") abstract class NonCacheableIntegrationTest : Test() val integrationTest by tasks.register("integrationTest") {