Print web link#683
Conversation
4388082 to
d91f778
Compare
Codecov Report
@@ Coverage Diff @@
## master #683 +/- ##
============================================
+ Coverage 77.26% 77.33% +0.07%
Complexity 633 633
============================================
Files 110 110
Lines 2555 2563 +8
Branches 364 365 +1
============================================
+ Hits 1974 1982 +8
+ Misses 348 347 -1
- Partials 233 234 +1 |
| if (printWebLink && webLink.isNotBlank()) { | ||
| printWebLink = false | ||
| println(webLink) | ||
| } |
There was a problem hiding this comment.
Is there a cleaner way to print the web link once per matrix?
There was a problem hiding this comment.
I am wondering if we could print this link using this logic in SavedMatrix
flank/test_runner/src/main/kotlin/ftl/json/SavedMatrix.kt
Lines 65 to 67 in d91f778
AFAIK link is updated only once for each matrix (please confirm that, I've tested it with couple of examples but might be some corner cases about which I am not aware of).
Also, I think we could print it in more user friendly way -- with indention, message saying what exactly this is etc.
Just thinking, let me know what you think.
There was a problem hiding this comment.
I like that idea!
My understanding is the matrix link is only updated once. I'll update the pull request.
There was a problem hiding this comment.
If we need to print web link ASAP "after starting run", I guess that the cleaner way is to do first refresh of matrices somewhere here. So the web link can be properly generated and printed before "PollMatrices" message will appears. But it's not good idea if number of additional pulls matters.
d91f778 to
08dae55
Compare
PollMatrices 0m 0s matrix-1h3w820q84crs NexusLowRes-28 VALIDATING 0m 0s matrix-1h3w820q84crs NexusLowRes-28 VALIDATING https://console.firebase.google.com/project/flank-open-source/testlab/histories/bh.bf178d418be9d33e/matrices/6081298694548031160 0m 5s matrix-1h3w820q84crs NexusLowRes-28 PENDING
7a0f5c4 to
50b76c8
Compare
|
|
||
| private tailrec suspend fun getOrUpdateWebLink(link: String, project: String, matrixId: String): String = | ||
| if (link.isNotBlank()) link | ||
| else getOrUpdateWebLink(GcTestMatrix.refresh(matrixId, project).webLink(), project, matrixId) |
There was a problem hiding this comment.
A matrix is not guaranteed to have a webLink. A matrix can be invalid.
https://github.com/Flank/flank/blob/master/test_runner/src/main/kotlin/ftl/util/MatrixState.kt
Here are the possible states:
"enumDescriptions": [
"Do not use. For proto versioning only.",
"The execution or matrix is being validated.",
"The execution or matrix is waiting for resources to become available.",
"The execution is currently being processed.\n\nCan only be set on an execution.",
"The execution or matrix has terminated normally.\n\nOn a matrix this means that the matrix level processing completed normally,\nbut individual executions may be in an ERROR state.",
"The execution or matrix has stopped because it encountered an\ninfrastructure failure.",
"The execution was not run because it corresponds to a unsupported\nenvironment.\n\nCan only be set on an execution.",
"The execution was not run because the provided inputs are incompatible with\nthe requested environment.\n\nExample: requested AndroidVersion is lower than APK's minSdkVersion\n\nCan only be set on an execution.",
"The execution was not run because the provided inputs are incompatible with\nthe requested architecture.\n\nExample: requested device does not support running the native code in\nthe supplied APK\n\nCan only be set on an execution.",
"The user cancelled the execution.\n\nCan only be set on an execution.",
"The execution or matrix was not run because the provided inputs are not\nvalid.\n\nExamples: input file is not of the expected type, is malformed\/corrupt, or\nwas flagged as malware"
],
"type": "string",
"enum": [
"TEST_STATE_UNSPECIFIED",
"VALIDATING",
"PENDING",
"RUNNING",
"FINISHED",
"ERROR",
"UNSUPPORTED_ENVIRONMENT",
"INCOMPATIBLE_ENVIRONMENT",
"INCOMPATIBLE_ARCHITECTURE",
"CANCELLED",
"INVALID"
]
I think only:
"VALIDATING",
"PENDING",
"RUNNING",
"FINISHED",will possibly have a webLink that we can poll for.
"TEST_STATE_UNSPECIFIED",
"UNSUPPORTED_ENVIRONMENT",
"INCOMPATIBLE_ENVIRONMENT",
"INCOMPATIBLE_ARCHITECTURE",
"CANCELLED",
"INVALID"I don't think we'll get a web link from these states. In the current implementation, will we poll indefinitely until a web link is provided?
There was a problem hiding this comment.
Thanks for input. I will implement additional logic to prevent this.
Fixes #645
Checklist