[kt-212-* only] Disable test CompatibilityVerifierVersionComparisonTest.testCurrentPluginVersionParsing

GitOrigin-RevId: f75bcadaa919962390140e961819de3da73e1df4
This commit is contained in:
Stanislav Erokhin
2022-01-22 11:10:01 +00:00
committed by intellij-monorepo-bot
parent d2980883b7
commit ca745327a4
2 changed files with 22 additions and 1 deletions
@@ -4,6 +4,7 @@ package org.jetbrains.kotlin.test
import com.intellij.testFramework.LightPlatformTestCase
import org.jetbrains.kotlin.idea.*
import org.jetbrains.kotlin.idea.test.util.ignored
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@@ -35,7 +36,19 @@ class CompatibilityVerifierVersionComparisonTest : LightPlatformTestCase() {
PlatformVersion.getCurrent() ?: throw AssertionError("Version should not be null")
}
/**
* This test is disabled in kt-212-[master|1.6.0] because it is stable fails here, because
* KotlinPluginUtil.getPluginVersion() == "212-1.6.20-dev-4868-IJSNAPSHOT" and SNAPSHOT idea version is not supported in version parser.
* That is happening because on teamcity, when tests are running there is no `kotlin.plugin.version` parameter and
* KotlinPluginUtil.getPluginVersion() fallbacks to reading version from plugin.xml.
* But this version is set by another logic: org.jetbrains.intellij.build.kotlin.KotlinPluginKind#version and it is reading
* IDEA version from the file community/build.txt (212-SNAPSHOT is stored there)
* In 211 and 213 branches test are ok because logic there is different somehow
*/
fun testCurrentPluginVersionParsing() {
if (ignored("see above")) return
val pluginVersion = KotlinPluginUtil.getPluginVersion()
if (pluginVersion == "@snapshot@") return
@@ -54,4 +54,12 @@ val CodeInsightTestFixture.elementByOffset: PsiElement
}
val File.slashedPath: String
get() = KotlinTestUtils.toSlashEndingDirPath(absolutePath)
get() = KotlinTestUtils.toSlashEndingDirPath(absolutePath)
/**
* This Util function is needed for manual test disabling via pattern:
* if (ignored("KT-xxx")) return
*
* We cannot just add return in the beginning of the test because we'll get warnings "unreachable code"
*/
fun ignored(@Suppress("UNUSED_PARAMETER") reason: String) = true