From a1250e838b593ce280d11a74c374a6a674c49c63 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 4 Aug 2023 18:25:20 +0200 Subject: [PATCH] Ignore compose experimental modules during artifacts check The check can be improved in the future, so not only parent directory is checked. --- .../jetbrains/kotlin/code/ArtifactsTest.kt | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/repo/artifacts-tests/src/test/kotlin/org/jetbrains/kotlin/code/ArtifactsTest.kt b/repo/artifacts-tests/src/test/kotlin/org/jetbrains/kotlin/code/ArtifactsTest.kt index 2ce3007041a..8c531a9740d 100644 --- a/repo/artifacts-tests/src/test/kotlin/org/jetbrains/kotlin/code/ArtifactsTest.kt +++ b/repo/artifacts-tests/src/test/kotlin/org/jetbrains/kotlin/code/ArtifactsTest.kt @@ -22,6 +22,16 @@ class ArtifactsTest { private val localRepoPath = Paths.get(mavenLocal, "org/jetbrains/kotlin") private val expectedRepoPath = Paths.get("repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin") + /** + * Experimental projects that might be published locally but are not epxected to be published by default. + * They still might be added to TeamCity maven.zip final artifacts with an additional code. + */ + private val experimentalProjects = setOf( + "compiler-hosted", + "compiler-daemon", + "compiler", + ) + private val excludedProjects = setOf( "annotation-processor-example", "android-test-fixes", @@ -51,12 +61,16 @@ class ArtifactsTest { }) actualPoms.forEach { actual -> val expectedPomPath = actual.toExpectedPath() - if ("${expectedPomPath.parent.fileName}" !in excludedProjects) { - val actualString = actual.toFile().readText().replace(kotlinVersion, "ArtifactsTest.version") - assertEqualsToFile(expectedPomPath, actualString) - visitedPoms.add(expectedPomPath) - } else { - if (isTeamCityBuild) fail("Excluded project in actual artifacts: $actual") + val parentDirName = expectedPomPath.parent.fileName.toString() + + if (parentDirName !in experimentalProjects) { + if (parentDirName !in excludedProjects) { + val actualString = actual.toFile().readText().replace(kotlinVersion, "ArtifactsTest.version") + assertEqualsToFile(expectedPomPath, actualString) + visitedPoms.add(expectedPomPath) + } else { + if (isTeamCityBuild) fail("Excluded project in actual artifacts: $actual") + } } }