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

Print retires & display additional info #779

Merged
merged 13 commits into from
May 18, 2020
Merged

Print retires & display additional info #779

merged 13 commits into from
May 18, 2020

Conversation

jan-goral
Copy link
Contributor

@jan-goral jan-goral commented May 12, 2020

Fixes #717 #681 #738

Checklist

  • Unit tested
  • release_notes.md updated

@jan-goral
Copy link
Contributor Author

AndroidArgs
    gcloud:
      results-bucket: test-lab-v9cn46bb990nx-kz69ymd4nm9aq
      results-dir: null
      record-video: false
      timeout: 15m
      async: false
      client-details: 
      network-profile: null
      results-history-name: null
      # Android gcloud
      app: /Users/janek/projects/flank-project/flank/test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-debug.apk
      test: /Users/janek/projects/flank-project/flank/test_runner/src/test/kotlin/ftl/fixtures/tmp/apk/app-multiple-flaky-debug-androidTest.apk
      additional-apks: 
      auto-google-login: false
      use-orchestrator: true
      directories-to-pull:
        - /sdcard/
      other-files:
      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: 3

    flank:
      max-test-shards: 2
      shard-time: -1
      num-test-runs: 1
      smart-flank-gcs-path: 
      smart-flank-disable-upload: false
      files-to-download:
        - .*/sdcard/[^/]+\.ec$
      test-targets-always-run:
      disable-sharding: false
      project: flank-open-source
      local-result-dir: results
      # Android Flank Yml
      keep-file-path: false
      additional-app-test-apks:
      run-timeout: -1
      legacy-junit-result: false
      ignore-failed-tests: false

RunTests

  Smart Flank cache hit: 0% (0 / 5)
  Shard times: 240s, 360s

  Uploading app-multiple-flaky-debug-androidTest.apk   Uploading app-debug.apk ..

  5 tests / 2 shards

  1 matrix ids created in 0m 7s
  https://console.developers.google.com/storage/browser/test-lab-v9cn46bb990nx-kz69ymd4nm9aq/2020-05-12_12-33-23.713000_vrEO/

Matrices webLink
  matrix-bxs7irgqf2mda https://console.firebase.google.com/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/7945200213789677367

  0m  1s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd PENDING
  0m  1s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h PENDING
  0m 32s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Starting attempt 1.
  0m 32s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd RUNNING
  0m 32s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Starting attempt 1.
  0m 32s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h RUNNING
  1m 22s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Started logcat recording.
  1m 22s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Preparing device.
  1m 28s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Started logcat recording.
  1m 28s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Preparing device.
  1m 46s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Installing apps.
  1m 46s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Installing apps.
  1m 59s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Retrieving Pre-Test Package Stats information from the device.
  1m 59s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Retrieving Performance Environment information from the device.
  1m 59s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Started crash detection.
  1m 59s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Started crash monitoring.
  1m 59s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Starting instrumentation test.
  2m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Retrieving Pre-Test Package Stats information from the device.
  2m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Retrieving Performance Environment information from the device.
  2m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Started crash detection.
  2m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Started crash monitoring.
  2m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Starting instrumentation test.
  2m 11s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Completed instrumentation test.
  2m 11s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Completed instrumentation test.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa PENDING
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Stopped crash monitoring.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Retrieving Post-test Package Stats information from the device.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Stopped logcat recording.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Done. Test time = 14 (secs)
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Starting results processing. Attempt: 1
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd Completed results processing. Time taken = 2 (secs)
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-22t43h1j7e2wd FINISHED
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr PENDING
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Stopped crash monitoring.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Retrieving Post-test Package Stats information from the device.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Stopped logcat recording.
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Done. Test time = 10 (secs)
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Starting results processing. Attempt: 1
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h Completed results processing. Time taken = 2 (secs)
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-0 execution-2ppaxo6r1ve1h FINISHED
  2m 35s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u PENDING
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Starting attempt 1.
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa RUNNING
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Starting attempt 1.
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr RUNNING
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Starting attempt 1.
  3m  0s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u RUNNING
  3m 49s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Started logcat recording.
  3m 49s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Preparing device.
  3m 49s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Started logcat recording.
  3m 49s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Preparing device.
  4m  2s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Started logcat recording.
  4m  2s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Preparing device.
  4m 15s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Installing apps.
  4m 15s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Installing apps.
  4m 15s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Retrieving Pre-Test Package Stats information from the device.
  4m 15s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Retrieving Performance Environment information from the device.
  4m 27s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Retrieving Pre-Test Package Stats information from the device.
  4m 27s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Retrieving Performance Environment information from the device.
  4m 27s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Started crash detection.
  4m 27s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Started crash monitoring.
  4m 27s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Starting instrumentation test.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Started crash detection.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Started crash monitoring.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Starting instrumentation test.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Installing apps.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Retrieving Pre-Test Package Stats information from the device.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Retrieving Performance Environment information from the device.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Started crash detection.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Started crash monitoring.
  4m 34s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Starting instrumentation test.
  4m 40s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Completed instrumentation test.
  4m 40s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Completed instrumentation test.
  4m 53s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Completed instrumentation test.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Stopped crash monitoring.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Retrieving Post-test Package Stats information from the device.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Stopped logcat recording.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Done. Test time = 13 (secs)
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Starting results processing. Attempt: 1
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa Completed results processing. Time taken = 2 (secs)
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-15nt5nhl4twoa FINISHED
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Stopped crash monitoring.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Retrieving Post-test Package Stats information from the device.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Stopped logcat recording.
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Done. Test time = 15 (secs)
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Starting results processing. Attempt: 1
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr Completed results processing. Time taken = 2 (secs)
  5m  5s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-2ohsc9p6f57pr FINISHED
  5m 11s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Stopped crash monitoring.
  5m 11s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Retrieving Post-test Package Stats information from the device.
  5m 18s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Stopped logcat recording.
  5m 18s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Done. Test time = 13 (secs)
  5m 18s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Starting results processing. Attempt: 1
  5m 24s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u Completed results processing. Time taken = 2 (secs)
  5m 24s matrix-bxs7irgqf2mda NexusLowRes-28 shard-1 execution-3gvs6r96igw5u FINISHED
  5m 24s matrix-bxs7irgqf2mda FINISHED
FetchArtifacts
  .....
  Updating matrix file

CostReport
  Virtual devices
    $0.08 for 5m

MatrixResultsReport
  0 / 1 (0.00%)
  1 matrices failed

Error: Matrix failed: matrix-bxs7irgqf2mda FINISHED failure  https://console.firebase.google.com/project/flank-open-source/testlab/histories/bh.da0c237aaa33732/matrices/7945200213789677367

Process finished with exit code 1

@jan-goral jan-goral force-pushed the 717-print-retries branch from 1ce78ca to 760fda1 Compare May 14, 2020 14:12
@jan-goral
Copy link
Contributor Author

jan-goral commented May 14, 2020

I have added 2 additional styles for displaying single & multi line shortened output. On consoles which not honors ansi codes multi line output will not be display correctly so single line output can be used.

Multi line output:

  3m  1s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-0 execution-1745swg41t0b2 FINISHED
  2m 55s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-1 execution-2tgcqxrrupgu5 FINISHED
  4m 58s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-1 execution-1689yp4w2xewa Starting instrumentation test.
  4m 23s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-0 execution-17j3zh3bwvc5m Preparing device.
  4m 52s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-0 execution-28h3aflk56m55 Installing apps.
  4m 58s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-0 execution-2fht77lyehkk8 Completed instrumentation test.
  4m 52s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-1 execution-3ttu7s12ylovo Starting instrumentation test.
  4m 58s matrix-3hy98fkuzmdpy NexusLowRes-28 shard-1 execution-ugdjrkzws8mka Starting instrumentation test.

Single line output (it's port of gcloud MonitorTestMatrixProgress function):

  3m 35s Test executions status: FINISHED:2 PENDING:2 RUNNING:4

In both cases old output is overwritten when status has changed
Single line output is a port from gcloud MonitorTestMatrixProgress function

I will add new flank option output_style to allow force specific style.
And I have to add some unit tests also.

@jan-goral jan-goral force-pushed the 717-print-retries branch from c3d2165 to 6ce9105 Compare May 14, 2020 15:12
@codecov-io
Copy link

codecov-io commented May 15, 2020

Codecov Report

Merging #779 into master will increase coverage by 0.53%.
The diff coverage is 81.48%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #779      +/-   ##
============================================
+ Coverage     78.50%   79.04%   +0.53%     
- Complexity      692      701       +9     
============================================
  Files           133      136       +3     
  Lines          2857     2921      +64     
  Branches        411      419       +8     
============================================
+ Hits           2243     2309      +66     
+ Misses          355      344      -11     
- Partials        259      268       +9     

@jan-goral jan-goral marked this pull request as ready for review May 15, 2020 04:19
@jan-goral jan-goral requested review from pawelpasterz, bootstraponline and adamfilipow92 and removed request for pawelpasterz May 15, 2020 04:35
@jan-goral jan-goral self-assigned this May 15, 2020
@jan-goral jan-goral mentioned this pull request May 15, 2020
3 tasks
@jan-goral jan-goral force-pushed the 717-print-retries branch from a79a83b to 735b50e Compare May 15, 2020 04:48
@jan-goral jan-goral force-pushed the 717-print-retries branch from 6e23e9a to bc58267 Compare May 15, 2020 05:21
pawelpasterz
pawelpasterz previously approved these changes May 15, 2020
Copy link
Contributor

@pawelpasterz pawelpasterz left a comment

Choose a reason for hiding this comment

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

Amazing and great work! I really like how logs look like now. That's huge new feature in flank.

General comment to my comments ( 😃 ) none is change request. Some are more about personal preferences and some (NPE related) might be too 'safe'. I'd love to get some responses from you and I am really curious about them.

Again,I like the code, nice!

@@ -47,3 +49,9 @@ interface IArgs {
val AVAILABLE_SHARD_COUNT_RANGE = 1..50
}
}

fun IArgs.outputStyle() = outputStyle ?: let {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think let is redundant here


fun IArgs.outputStyle() = outputStyle ?: let {
if (flakyTestAttempts > 0 || (!disableSharding && maxTestShards > 0))
OutputStyle.Multi else
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I know I'm again and again about the same but really don't like formatting like this 😄 But as usual -- matter of personal preferences so don't bother my comment

stopWatch.start()
}

private val cache = testMatricesIds.map { it to MatrixState.PENDING }.toMap().toMutableMap()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can simplify this with .associateWith

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, I missed this, thx.

delay(5_000)
refreshedMatrix = GcTestMatrix.refresh(matrixId, args.project)
val matrix = GcTestMatrix.refresh(testMatrixId, projectId)
emit(matrix)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if we should not check matrix.testMatrixId for null. TestMatrix is java object and according to docs

/**
   * Output only. Unique id set by the service.
   * @return value or {@code null} for none
   */
  public java.lang.String getTestMatrixId() {
    return testMatrixId;
  }

I know it doesn't make sense to have null here and there is no reason why FTL return would want null here. We have some experience with FTL API and sometimes it returns errors or broken objects. (even recently there was a case when FTL returned test execution without time and that caused flank to blow).
If null would appear here we could have NPE in L35 matrices + (next.testMatrixId to next) or TestMatrixStatusPrinter#invoke -> cache[matrix.testMatrixId] = matrix.state.
If such case would occur we can use as fallback (and assign) testMatrixId passed as method's argument.

I don't know, maybe I'm overreacting :) Let me know what you think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe you have right but is should be done by GcTestMatrix.refresh, not here

@@ -20,7 +21,7 @@ suspend fun newTestRun(args: IArgs) {
val (matrixMap, testShardChunks) = cancelTestsOnTimeout(args.project) { runTests(args) }

if (!args.async) {
cancelTestsOnTimeout(args.project, matrixMap.map) { pollMatrices(matrixMap, args) }
cancelTestsOnTimeout(args.project, matrixMap.map) { pollMatrices(matrixMap.map.keys, args).update(matrixMap) }
Copy link
Contributor

Choose a reason for hiding this comment

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

How about moving update to the end of pollMatrices (in PollMatrices.kt) method chain? Same for RefreshLastRun.kt. Then it would be extension function available inside this file.

Let me know what you think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea was that pollMatrices shoud not be aware of SavedMatrix. SavedMatrix looks like old school java class. I dont like black boxes. I have plans to get rid of it in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sens, thanks.

val time = stopWatch.check(alignSeconds = true)
printExecutionStatusList(time, matrix.testExecutions)
cache[matrix.testMatrixId] = matrix.state
if (allMatricesCompleted) printTestMatrixStatusList(time)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if it's best solution to print all matrices status when all of them are finished. There might be one test pair with very few tests and could end couple of minutes (or more) before the rest. In such case user should be notified immediately.

On the other hand I am not sure if this is doable in a way to preserve current logs structure (matrix final status at the end of all logs) which is great...
Let me know what you think and if this is possible to achieve, thanks!

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 will think about that but pls, not in this PR.

private fun TestExecution.formatName(args: IArgs): String {
val matrixExecutionId = id.split("_")
val matrixId = matrixExecutionId.first()
val executionId = matrixExecutionId.takeIf { args.flakyTestAttempts > 0 }?.getOrNull(1)?.let { " $it" } ?: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if executionId is that much needed (in that form). I understand intention to explicitly indicate if it's re-run or not. As user I would expect here info that is similar to FTL console.
image

But hey, this PR is big enough without that feature. And I don't know if it's easy easy to achieve it. I think this is something we can try to improve in the future.
Let me know what you think.

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 agree, in the future. ;)

}

private fun TestExecution.executionStatus() = ExecutionStatus(
state = state,
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential NPE here

}

private fun TestExecution.formatName(args: IArgs): String {
val matrixExecutionId = id.split("_")
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential NPE here

}
}

private val listExecutionStatusView: (ExecutionStatus.Change) -> List<ExecutionStatus.View>
Copy link
Contributor

Choose a reason for hiding this comment

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

How about extension property here instead? Something like (just proposal, not change request :) ):

private val ExecutionStatus.Change.views: List<ExecutionStatus.View>
    get() = current.progress
        .minus(previous.progress)
        .map { ExecutionStatus.View(time, name, it) }
        .let { list ->
            if (current.error != previous.error && current.error != null)
                list + ExecutionStatus.View(time, name, "Error: ${current.error}")
            else list
        }
        .let { list ->
            if (current.state != previous.state)
                list + ExecutionStatus.View(time, name, current.state)
            else list
        }

Let me know what you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't make much difference, but I can change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO it's more clear when I see sth like
change.views.takeLast
but I don't want to force anything.

@jan-goral jan-goral requested a review from pawelpasterz May 15, 2020 20:49
@bootstraponline bootstraponline added this to the June milestone May 16, 2020
pawelpasterz
pawelpasterz previously approved these changes May 16, 2020
Co-authored-by: Nelson Osacky <[email protected]>
@jan-goral jan-goral dismissed stale reviews from pawelpasterz via 8708398 May 18, 2020 14:48
@jan-goral jan-goral requested a review from pawelpasterz May 18, 2020 14:49
@jan-goral jan-goral merged commit 6ee6939 into master May 18, 2020
@bootstraponline bootstraponline deleted the 717-print-retries branch May 18, 2020 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants