Skip to content

Commit

Permalink
Cr fixes, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfilipow92 committed Dec 7, 2020
1 parent 0f5faf9 commit 8928dcf
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
8 changes: 5 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,12 @@ flank:
## The JUnit XML is used to determine failure. (default: false)
# ignore-failed-tests: true

### Output Style
## Output style of execution status. May be one of [verbose, multi, single].
### Output Style flag
## Output style of execution status. May be one of [verbose, multi, single, compact].
## For runs with only one test execution the default value is 'verbose', in other cases
## 'multi' is used as the default. The output style 'multi' is not displayed correctly on consoles
## which don't support ansi codes, to avoid corrupted output use single or verbose.
## The output style `compact` is used to produce less detailed output, it prints just Args, test and matrix count, weblinks, cost, and result reports.
# output-style: single

### Full Junit Result flag
Expand Down Expand Up @@ -650,10 +651,11 @@ flank:
# legacy-junit-result: false

### Output Style flag
## Output style of execution status. May be one of [verbose, multi, single].
## Output style of execution status. May be one of [verbose, multi, single, compact].
## For runs with only one test execution the default value is 'verbose', in other cases
## 'multi' is used as the default. The output style 'multi' is not displayed correctly on consoles
## which don't support ansi codes, to avoid corrupted output use single or verbose.
## The output style `compact` is used to produce less detailed output, it prints just Args, test and matrix count, weblinks, cost, and result reports.
# output-style: single

### Full Junit Result flag
Expand Down
2 changes: 1 addition & 1 deletion flank-scripts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ shadowJar.apply {
}
}
// <breaking change>.<feature added>.<fix/minor change>
version = "1.1.5"
version = "1.1.4"
group = "com.github.flank"

application {
Expand Down
3 changes: 2 additions & 1 deletion test_runner/flank.ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,11 @@ flank:
# ignore-failed-tests: true

### Output Style
## Output style of execution status. May be one of [verbose, multi, single].
## Output style of execution status. May be one of [verbose, multi, single, compact].
## For runs with only one test execution the default value is 'verbose', in other cases
## 'multi' is used as the default. The output style 'multi' is not displayed correctly on consoles
## which don't support ansi codes, to avoid corrupted output use single or verbose.
## The output style `compact` is used to produce less detailed output, it prints just Args, test and matrix count, weblinks, cost, and result reports.
# output-style: single

### Full Junit Result flag
Expand Down
3 changes: 2 additions & 1 deletion test_runner/flank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ flank:
# legacy-junit-result: false

### Output Style flag
## Output style of execution status. May be one of [verbose, multi, single].
## Output style of execution status. May be one of [verbose, multi, single, compact].
## For runs with only one test execution the default value is 'verbose', in other cases
## 'multi' is used as the default. The output style 'multi' is not displayed correctly on consoles
## which don't support ansi codes, to avoid corrupted output use single or verbose.
## The output style `compact` is used to produce less detailed output, it prints just Args, test and matrix count, weblinks, cost, and result reports.
# output-style: single

### Full Junit Result flag
Expand Down
2 changes: 1 addition & 1 deletion test_runner/src/main/kotlin/ftl/args/IArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ interface IArgs {
val IArgs.logLevel
get() = if (outputStyle == OutputStyle.Compact) OutputLogLevel.SIMPLE else OutputLogLevel.DETAILED

fun IArgs.setLogLevel() = also {
fun IArgs.setupLogLevel() = also {
ftl.log.setLogLevel(logLevel)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ftl.cli.firebase.test.android

import ftl.args.AndroidArgs
import ftl.args.setLogLevel
import ftl.args.setupLogLevel
import ftl.args.validate
import ftl.cli.firebase.test.CommonRunCommand
import ftl.config.FtlConstants
Expand Down Expand Up @@ -46,7 +46,7 @@ class AndroidRunCommand : CommonRunCommand(), Runnable {
}

AndroidArgs.load(Paths.get(configPath), cli = this).validate().run {
setLogLevel()
setupLogLevel()
runBlocking {
if (dumpShards) dumpShards()
else newTestRun()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ftl.cli.firebase.test.ios

import ftl.args.IosArgs
import ftl.args.setLogLevel
import ftl.args.setupLogLevel
import ftl.args.validate
import ftl.cli.firebase.test.CommonRunCommand
import ftl.config.FtlConstants
Expand Down Expand Up @@ -46,7 +46,7 @@ class IosRunCommand : CommonRunCommand(), Runnable {
}

IosArgs.load(Paths.get(configPath), cli = this).validate().run {
setLogLevel()
setupLogLevel()
if (dumpShards) dumpShards()
else runBlocking { newTestRun() }
}
Expand Down
8 changes: 4 additions & 4 deletions test_runner/src/main/kotlin/ftl/log/OutputLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ fun setLogLevel(logLevel: OutputLogLevel) {
minimumLogLevel = logLevel
}

fun log(message: Any, level: OutputLogLevel = OutputLogLevel.SIMPLE) =
fun log(message: Any, level: OutputLogLevel = OutputLogLevel.SIMPLE) {
if (minimumLogLevel >= level) print(message)
else Unit
}

fun logLn(message: Any = "", level: OutputLogLevel = OutputLogLevel.SIMPLE) =
fun logLn(message: Any = "", level: OutputLogLevel = OutputLogLevel.SIMPLE) {
if (minimumLogLevel >= level) println(message)
else Unit
}

private var minimumLogLevel: OutputLogLevel = OutputLogLevel.DETAILED

Expand Down

0 comments on commit 8928dcf

Please sign in to comment.