Skip to content

Commit

Permalink
Don't print Gradle and swiftc output on CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKriz committed Apr 14, 2024
1 parent b7ec023 commit 8db3203
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ abstract class BaseGradleTests: TestUtilsTrait, GradleBuildFileBuilderTrait {
},
): BuildResult {
val result: BuildResult = GradleRunner.create()
.withProjectDir(testProjectDir)
.withGradleVersion(gradleVersion)
.withArguments(*arguments)
.forwardOutput()
// .withDebug(true)
.apply {
withProjectDir(testProjectDir)
withGradleVersion(gradleVersion)
withArguments(*arguments)
if (!isCI) {
forwardOutput()
}
}
.build()

assertResult?.invoke(result)
Expand Down Expand Up @@ -108,7 +111,9 @@ abstract class BaseGradleTests: TestUtilsTrait, GradleBuildFileBuilderTrait {
}

val result = command.joinToString(" ").execute(testProjectDir)
println(result.stdOut)
if (!isCI) {
println(result.stdOut)
}

assertResult?.invoke(result)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface TestUtilsTrait {
get() = File(System.getProperty("user.dir"))
val tempRepository: File
get() = File(System.getProperty("smokeTestRepository"))
val isCI: Boolean
get() = System.getenv("CI") == "true"

operator fun File.invoke(content: String) = writeText(content)

Expand Down

0 comments on commit 8db3203

Please sign in to comment.