Skip to content

Commit

Permalink
Migrate diktat smoke tests to SAVE-cli mechanism
Browse files Browse the repository at this point in the history
### What's done:
* migrated diktat smoke tests to SAVE-cli mechanism
Closes #1383
  • Loading branch information
Cheshiriks committed Jul 11, 2022
1 parent fa10731 commit 3785fe8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ open class FixTestBase(
}

private fun getProcessBuilder(expectedPath: String, testPath: String): ProcessBuilder {
val saveDir = "src/test/resources/test/smoke"
val saveDir = "src/test/resources/test/smoke/${getSaveForCurrentOs()}"
val filesDir = "src/test/resources/test/smoke/${getSaveForCurrentOs()}"
val systemName = System.getProperty("os.name")
return when {
systemName.startsWith("Linux", ignoreCase = true) || systemName.startsWith("Mac", ignoreCase = true) ->
ProcessBuilder("chmod", "-R", "777", saveDir, "&", saveDir, "src/test/resources/test/smoke/src/main/kotlin", expectedPath, testPath)
ProcessBuilder("chmod", "-R", "777", filesDir, "&", saveDir, "src/test/resources/test/smoke/src/main/kotlin", expectedPath, testPath)
else -> ProcessBuilder(saveDir, "src/test/resources/test/smoke/src/main/kotlin", expectedPath, testPath)
}
}
Expand Down Expand Up @@ -119,7 +120,7 @@ open class FixTestBase(
?.single { it.name.contains("diktat") }
?.pathString ?: ""

val file = File("tmpSave.txt")
val file = File("src/test/resources/test/smoke/tmpSave.txt")
val diktat = File("src/test/resources/test/smoke/diktat.jar")
val configFile = File("src/test/resources/test/smoke/diktat-analysis.yml")
val diktatFrom = File(diktatDir)
Expand Down
2 changes: 1 addition & 1 deletion diktat-rules/src/test/resources/test/smoke/save.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[general]
execCmd="chmod 777 ktlint & chmod 777 diktat.jar & java -jar ktlint -R diktat.jar"
execCmd="java -jar ktlint -R diktat.jar"
tags = ["smokeTest"]
description = "SmokeTest"
suiteName = "SmokeTest"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[general]
execCmd="chmod 777 ktlint & chmod 777 diktat.jar & java -jar ktlint -R diktat.jar"
execCmd="java -jar ktlint -R diktat.jar"
tags = ["smokeTest"]
description = "SmokeTest"
suiteName = "SmokeTest"
Expand Down

0 comments on commit 3785fe8

Please sign in to comment.