From 23ec13eaff53f0054df0bd2e5e87ceba2722bd79 Mon Sep 17 00:00:00 2001 From: Vfrolov Date: Thu, 14 Jul 2022 17:36:12 +0300 Subject: [PATCH] Migrate diktat smoke tests to SAVE-cli mechanism ### What's done: * migrated diktat smoke tests to SAVE-cli mechanism Closes #1383 --- .../org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt | 2 +- .../src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt index 59b4030440..1aa21c7036 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt @@ -1,5 +1,6 @@ package org.cqfn.diktat.ruleset.smoke +import org.cqfn.diktat.util.SAVE_VERSION import org.apache.commons.io.FileUtils import org.apache.http.client.methods.CloseableHttpResponse import org.apache.http.client.methods.HttpGet @@ -66,7 +67,6 @@ class DiktatSaveSmokeTest : DiktatSmokeTestBase() { companion object { private const val KTLINT_VERSION = "0.46.1" - private const val SAVE_VERSION = "0.3.2" private fun getSaveForCurrentOs() = when { System.getProperty("os.name").startsWith("Linux", ignoreCase = true) -> "save-$SAVE_VERSION-linuxX64.kexe" diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt index c9c8759f17..59d1a4ce78 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt @@ -11,6 +11,8 @@ import java.nio.file.Path import kotlin.io.path.bufferedWriter import kotlin.io.path.div +const val SAVE_VERSION: String = "0.3.2" + /** * @property resourceFilePath path to files which will be compared in tests */ @@ -128,8 +130,4 @@ open class FixTestBase( return testComparatorUnit.compareFilesFromFileSystem(expected, actual) } - - companion object { - private const val SAVE_VERSION = "0.3.2" - } }