Skip to content

Clean tests output #8352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Dotty CI

on: [push, pull_request]

env:
DOTTY_CI_RUN: true

jobs:
test:
runs-on: self-hosted
Expand Down
5 changes: 3 additions & 2 deletions compiler/test/dotty/Properties.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ object Properties {
prop == null || prop == "TRUE"
}

/** Are we running on the Drone CI? */
val isRunByDrone: Boolean = sys.env.isDefinedAt("DRONE")
/** Are we running on the CI? */
val isRunByCI: Boolean = sys.env.isDefinedAt("DOTTY_CI_RUN")
|| sys.env.isDefinedAt("DRONE") // TODO remove this when we drop Drone

/** Tests should run interactive? */
val testsInteractive: Boolean = propIsNullOrTrue("dotty.tests.interactive")
Expand Down
12 changes: 3 additions & 9 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -417,21 +417,15 @@ trait ParallelTesting extends RunnerOrchestration { self =>
* if it did, the test should automatically fail.
*/
protected def tryCompile(testSource: TestSource)(op: => Unit): Unit =
try {
val testing = s"Testing ${testSource.title}"
summaryReport.echoToLog(testing)
if (!isInteractive) realStdout.println(testing)
op
} catch {
case e: Throwable => {
try op
catch
case e: Throwable =>
// if an exception is thrown during compilation, the complete test
// run should fail
failTestSource(testSource)
e.printStackTrace()
registerCompletion()
throw e
}
}

protected def compile(files0: Array[JFile], flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = {
val flags = flags0.and("-d", targetDir.getPath)
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/vulpix/SummaryReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ final class SummaryReport extends SummaryReporting {
}

object SummaryReport {
val isInteractive = Properties.testsInteractive && !Properties.isRunByDrone
val isInteractive = Properties.testsInteractive && !Properties.isRunByCI
}