Skip to content
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

feat: Add new output style to print smaller output #1375

Merged
merged 6 commits into from
Dec 7, 2020

Conversation

adamfilipow92
Copy link
Contributor

@adamfilipow92 adamfilipow92 commented Dec 4, 2020

Fixes #1306

Test Plan

How do we know the code works?

  1. When using single, verbose, multi output style, the output should not change.
  2. Set output style to compact (I'm not sure it's the best name for that, feel free to suggest other)
  3. In this output style we should print: yaml, count of test and shards, link to firebase and matrix web links, matrix and cost reports, table with results

Output example


WARNING: disable-sharding enabled with max-test-shards = 1, Flank will ignore max-test-shard and disable sharding.
AndroidArgs
    gcloud:
      results-bucket: test-lab-v9cn46bb990nx-kz69ymd4nm9aq
      results-dir: 2020-12-04_16-34-33.963626_WvMf
      record-video: false
      timeout: 15m
      async: false
      client-details:
      network-profile: null
      results-history-name: null
      # Android gcloud
      app: /Users/adamfilipowicz/Repos/flank/test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-debug.apk
      test: /Users/adamfilipowicz/Repos/flank/test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-single-success-debug-androidTest.apk
      additional-apks:
      auto-google-login: false
      use-orchestrator: true
      directories-to-pull:
      grant-permissions: all
      type: null
      other-files:
      scenario-numbers:
      scenario-labels:
      obb-files:
      obb-names:
      performance-metrics: false
      num-uniform-shards: null
      test-runner-class: null
      test-targets:
      robo-directives:
      robo-script: null
      device:
        - model: NexusLowRes
          version: 28
          locale: en
          orientation: portrait
      num-flaky-test-attempts: 0
      test-targets-for-shard:
      fail-fast: false

    flank:
      max-test-shards: 1
      shard-time: -1
      num-test-runs: 1
      smart-flank-gcs-path: 
      smart-flank-disable-upload: false
      default-test-time: 120.0
      use-average-test-time-for-new-tests: false
      files-to-download:
      test-targets-always-run:
      disable-sharding: true
      project: flank-open-source
      local-result-dir: results
      full-junit-result: false
      # Android Flank Yml
      keep-file-path: false
      additional-app-test-apks:
      run-timeout: -1
      legacy-junit-result: false
      ignore-failed-tests: false
      output-style: compact
      disable-results-upload: false
      default-class-test-time: 240.0

RunTests
  1 test / 1 shard

  1 matrix ids created in 0m 18s
  https://console.developers.google.com/storage/browser/test-lab-v9cn46bb990nx-kz69ymd4nm9aq/2020-12-04_16-34-33.963626_WvMf

Matrices webLink
  matrix-1wl88r1wuwgov https://console.firebase.google.com/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/4778909069129894447/executions/bs.b22378a05c11ef79

  3m 46s matrix-1wl88r1wuwgov FINISHED

CostReport
  Virtual devices
    $0.02 for 1m

MatrixResultsReport
  1 / 1 (100.00%)
┌─────────┬──────────────────────┬────────────────────────────┬────────────────────────────────┐
│ OUTCOME │      MATRIX ID       │      TEST AXIS VALUE       │          TEST DETAILS          │
├─────────┼──────────────────────┼────────────────────────────┼────────────────────────────────┤
│ success │ matrix-1wl88r1wuwgov │ NexusLowRes-28-en-portrait │ 1 test cases passed, 1 skipped │
└─────────┴──────────────────────┴────────────────────────────┴────────────────────────────────┘
  
Matrices webLink
  matrix-1wl88r1wuwgov https://console.firebase.google.com/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/4778909069129894447/executions/bs.b22378a05c11ef79


Process finished with exit code 0

Checklist

  • Documented
  • Unit tested
  • Integration tests passes

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2020

Timestamp: 2020-12-07 16:08:47
Buildscan url for ubuntu-workflow run 406226559

@adamfilipow92 adamfilipow92 marked this pull request as ready for review December 7, 2020 11:59
Copy link
Contributor

@Sloox Sloox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@bootstraponline bootstraponline force-pushed the 1306-make-the-flank-output-smaller branch from 65dd556 to 0f5faf9 Compare December 7, 2020 13:32
1. ```Simple, multi``` and ```verbose``` output style prints logs from ```SIMPLE``` and ```DETAILED``` levels.
1. ```Compact``` style prints log only from ```SIMPLE``` level.
1. If you want a print message for all output styles uses ```log``` or ```logLn``` with only ```message``` parameter.
1. If you want print message more detailed message use ```log``` or ```logLn``` and set ```level``` to ```OutputLogLevel.DETAILED```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update the # output-style: single section in the user facing docs & example yaml files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Docs and yaml examples updated.

@@ -28,7 +28,7 @@ shadowJar.apply {
}
}
// <breaking change>.<feature added>.<fix/minor change>
version = "1.1.4"
version = "1.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I check it one more time and it's fine with 1.1.4. I revert it and we check on CI.


fun IArgs.setLogLevel() = also {
ftl.log.setLogLevel(logLevel)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO setSomething needs some parameter, so I would suggest to rename it to setupLogLevel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not return need output from this method so I suggest to

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@codecov-io
Copy link

Codecov Report

Merging #1375 (8928dcf) into master (5cc0f1b) will increase coverage by 77.84%.
The diff coverage is 58.26%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master    #1375       +/-   ##
=============================================
+ Coverage          0   77.84%   +77.84%     
- Complexity        0      706      +706     
=============================================
  Files             0      245      +245     
  Lines             0     4713     +4713     
  Branches          0      904      +904     
=============================================
+ Hits              0     3669     +3669     
- Misses            0      551      +551     
- Partials          0      493      +493     

@piotradamczyk5 piotradamczyk5 self-requested a review December 7, 2020 16:17
@mergify mergify bot merged commit 628a018 into master Dec 7, 2020
@mergify mergify bot deleted the 1306-make-the-flank-output-smaller branch December 7, 2020 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the flank output smaller
5 participants