-
Notifications
You must be signed in to change notification settings - Fork 340
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
Gauge should create screenshot and share the file details with plugin instead of sharing the base64 encoded screenshot. #1476
Comments
To write the screenshots to file and share details, we discussed the following two approaches
|
We discussed both approaches and decided to go with the second one. Here are a few more details about it
|
We did a spike with the discussed approach (option 2). Turns out it slows the execution time significantly. Here are some findings: We ran a sample gauge-js project with 6 specifications. Each specification generates 6 screenshots. 5 captured via gauge API (gauge.screenshot) and 1 failure screenshot. So total number of screenshot becomes 36. Without writing to file (The current behaviour) the execution time was 7.861 seconds. After digging more into it we found that most of this extra time is being used in encoding the base64 to png. We need to do that because Runner sends the screenshot in base64 format, and we need to convert it to PNG. We discussed a new approach to deal with this problem:
|
The proposed solution is still a workaround for the right approach. There is value in having the image data as a part of the returned message and Gauge can decide what to do with it and how to store it. Can't we just solve it the right way instead of the runner taking screenshot and only returning paths? I feel it's not the runner's responsibility to figure out saving of files. It also adds another point of failure if something goes wrong in saving the files. |
Agree, If runner starts returning path, we may have to change the way custom screenshot works. |
As @BugDiver has mentioned here Gauge writing screenshots to a file increases the execution time significantly. |
We will have to change the contract of custom screenshot grabber to write the screenshot data to a file and return the file path. |
@negiDharmendra I see one drawback with the runner writing to the file and not Gauge. The runner will be forced to run in the same machine as that of Gauge. This will limit the architecture in certain ways. |
@nehashri Agreed, this approach will be a problem if we decided to change the Gauge and runner architecture in a way where they can run on two different machines. |
…#22) * Added field to share pre and post execution hook screenshot file path with the plugins. getgauge/gauge#1476 * Added deprecation warning for field to contain screenshot bytes. getgauge/gauge#1476
Going forward all the runner will write the screenshots into the file and just share the file path with Gauge and Gauge will do the same by sharing the screenshots file with other plugins. Having said that we have to decide on how do we handle the backward compatibility.
There are two approaches to ensure backward compatibility.
|
The second approach sounds confusing because it involves releasing all the plugins with the capability. This means backward compatibility is broken. If this proving to be as complex can we just assume that version of Gauge that passes the file paths while set compatibility and force upgrade of all plugins to a version that accepts file paths? |
…ng screenshots bytes. getgauge/gauge#1476
- Rename file_based_screengrabber to custom_screenshot_writer - Add missing test for configuration.
…ng screenshots bytes. getgauge/gauge#1476
* Updated gauge proto message. getgauge/gauge#1476 * Use protobuf-maven-plugin to generate Java proto files. * Refactored LspServer to Use Message builder * Write screenshots to file and return the file path instead of returning screenshots bytes. getgauge/gauge#1476 * Introduced an interface for file based screenshot grabber. getgauge/gauge#1476 * Deprecate CustomScreenshotGrabber interface. getgauge/gauge#1476
…ng screenshots bytes. getgauge/gauge#1476
Dev note: If we define Current Behaviour:
Currently to make it work as the excepted user have to create the dir. inside the project manually which should not be the case |
- Change default and custome screenshot api <screenshotFn> to write screenshots to file. - Add a new API customScreenshotWriter
This issue has been tested and found fixed.
|
Where can I find the html-report 4.0.9 and Java .7.4? I installed Gauge 1.0.7 with html-report 4.0.8 and Java .7.3 on a Linux machine. The log size is almost 1GB. I have switch back to Gauge 1.0.5. |
I am not sure if this is related, but I have installed gauge 1.0.8. |
Sending base64 encoded screenshot data with the
SuiteExecutionResult
increases the proto message size which causes #1239, getgauge/html-report#218 especially when there are a lot of screenshots in theSuiteExecutionResult
.To mitigate all above-mentioned issues we thought of streaming
ExecutionResult
to the plugins as soon as execution starts. It seems to be the right thing to do but then the plugins will have to own the responsibility of accumulating the result.There is another approach by whihc we can mitigate above-mentioned issues.
Instead of shareing the base64 encoded screenshot Gauge can save the screenshot under the reports directory and can send the files path to plugin.
The text was updated successfully, but these errors were encountered: