-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
#796 Improved the screen recorder for creating more than 3 minutes long videos #939
#796 Improved the screen recorder for creating more than 3 minutes long videos #939
Conversation
@@ -44,7 +44,7 @@ class RemoteFileManager(private val device: AndroidDevice) { | |||
} | |||
|
|||
companion object { | |||
const val MAX_FILENAME = 255 | |||
const val MAX_FILENAME = 254 //we need 1 more char for fileNumber in case of using video attachment > 180 && apiLevel < 34 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constant is not specific for video files so it should never change. It's a detail about Android filesystem implementation. I suggest changing the logic of the code, not the constants here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -24,3 +24,5 @@ fun String.escape(): String { | |||
} | |||
|
|||
val escapeRegex = "[^a-zA-Z0-9\\.\\#]".toRegex() | |||
|
|||
fun String.addFileNumberForVideo(fileNumber: String) = "${this.split(".mp4")[0]}$fileNumber.mp4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like very specific thing for stringextensions. I suggest putting this somewhere closer to the video file creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
device.safePullFile(remoteFilePath, localVideoFile.toString()) | ||
localVideoFiles.add(localVideoFile) | ||
} else { | ||
for (i in 0 .. (videoConfiguration.timeLimit / 180)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that the actual number of files depends on the time the test took, not the configuration limit, so the loop should take into account only the time passed or/and number of shell invocations with screenrecord
binary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Thanks for submitting this @SergKhram The idea is solid, I think it needs a little bit more work on the handling the number of files as well as the file naming. Your assumption about needing only 1 character holds true only if there are less than 10 video files. Supporting this feature means that marathon should handle even more than that, so likely the trimming should happen the same way as it does for other files to fit into the max file name length |
…-recorder' into feature/ISSUE-796/improve-screen-recorder
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #939 +/- ##
=============================================
+ Coverage 57.73% 57.93% +0.20%
- Complexity 813 832 +19
=============================================
Files 220 221 +1
Lines 4633 4736 +103
Branches 765 777 +12
=============================================
+ Hits 2675 2744 +69
- Misses 1605 1632 +27
- Partials 353 360 +7 ☔ View full report in Codecov by Sentry. |
vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AdamAndroidDevice.kt
Outdated
Show resolved
Hide resolved
vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AdamAndroidDevice.kt
Outdated
Show resolved
Hide resolved
...iguration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/VideoConfiguration.kt
Outdated
Show resolved
Hide resolved
vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AdamAndroidDevice.kt
Outdated
Show resolved
Hide resolved
vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AdamAndroidDevice.kt
Outdated
Show resolved
Hide resolved
...-android/src/main/kotlin/com/malinskiy/marathon/android/extension/ConfigurationExtensions.kt
Outdated
Show resolved
Hide resolved
...id/src/main/kotlin/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorder.kt
Outdated
Show resolved
Hide resolved
...n/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestBatchListener.kt
Outdated
Show resolved
Hide resolved
...n/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestBatchListener.kt
Outdated
Show resolved
Hide resolved
...n/com/malinskiy/marathon/android/executor/listeners/video/ScreenRecorderTestBatchListener.kt
Outdated
Show resolved
Hide resolved
...iguration/src/main/kotlin/com/malinskiy/marathon/config/vendor/android/VideoConfiguration.kt
Outdated
Show resolved
Hide resolved
85aad42
to
f23ee90
Compare
f23ee90
to
5316ba3
Compare
fdb065a
to
51d7cc0
Compare
@Vacxe waiting for merge |
#796
As mentioned there I prepared the solution
If apiLevel >= 34 -> we use time from VideoConfiguration
else -> we divide to 180sec videos if timeLimit > 180