Skip to content

Commit

Permalink
🧪 Fix Gradle test for GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Oct 9, 2023
1 parent 1f6d817 commit b4141a1
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/test/kotlin/org/jetbrains/qodana/tasks/QodanaScanTaskTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,17 @@ class QodanaScanTaskTest : BaseTest() {
@Test
fun `run qodana in a non-empty directory and fail with threshold`() {
val githubActions = "true".equals(System.getenv("GITHUB_ACTIONS"), ignoreCase = true)
val isMacOS = System.getProperty("os.name").contains("Mac OS X")
Assume.assumeFalse(githubActions && isMacOS)

val notLinux = !System.getProperty("os.name").contains("Linux")

if (githubActions && notLinux) {
buildFile.groovy("""
$EXTENSION_NAME {
}
$QODANA_SCAN_TASK_NAME {
arguments = ["--ide", "QDPYC"] // "--property=idea.headless.enable.statistics=false"]
}
""")
} else {
buildFile.groovy("""
val isLinux = System.getProperty("os.name").contains("Linux")
if (githubActions) {
Assume.assumeTrue(isLinux)
}
buildFile.groovy("""
$EXTENSION_NAME {
}
$QODANA_SCAN_TASK_NAME {
arguments = ["--fail-threshold", "0", "--property=idea.headless.enable.statistics=false"]
}
""")
}
""".trimIndent())
file("main.py").writeText("print('Hello, world!')\n\n\n\n\n\nprint()")
file("qodana.yaml").writeText("linter: jetbrains/qodana-python-community")
try {
Expand Down

0 comments on commit b4141a1

Please sign in to comment.