-
Notifications
You must be signed in to change notification settings - Fork 41
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
Mitigate risk of panic on parse of remote object during console.log #1129
Merged
Commits on Dec 11, 2023
-
These new functions are to be used when parsing the console message which is being printed by the website under test when it used console.log. Since these are string values that will be parsed and reprinted to stdout, we don't necessarily need to parse a json string into a go object (which is the main motivation for this change). This will avoid situations where k6 browser panics and causes the test run to end due to not being able to parse a json string. Other areas of the implementation (e.g. toJSON or eval) still require a go representation of the object and they will work with the existing parse functions.
Configuration menu - View commit details
-
Copy full SHA for a597741 - Browse repository at this point
Copy the full SHA a597741View commit details -
Configuration menu - View commit details
-
Copy full SHA for 393eccd - Browse repository at this point
Copy the full SHA 393eccdView commit details -
Since a string is already a string, we don't need to marshal it back to a string. This will be used when working with console messages which are printed by the website under test.
Configuration menu - View commit details
-
Copy full SHA for a877ade - Browse repository at this point
Copy the full SHA a877adeView commit details -
Refactor frameSession onConsoleAPICalled
Work with parseConsoleRemoteObject so that the browser module avoids trying to unmarshal objects from json to a go object. This doesn't feel like a worthwhile operation since the string will be printed to stdout.
Configuration menu - View commit details
-
Copy full SHA for 5a8e0ab - Browse repository at this point
Copy the full SHA 5a8e0abView commit details -
Refactor page's onConsoleAPICalled
Work with parseConsoleRemoteObject and strings rather than any types. The page.on API works with strings so there's no need to try to parse a json object to a go object and then back to a js object.
Configuration menu - View commit details
-
Copy full SHA for 456b277 - Browse repository at this point
Copy the full SHA 456b277View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8d899e - Browse repository at this point
Copy the full SHA b8d899eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51f987a - Browse repository at this point
Copy the full SHA 51f987aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b028d3 - Browse repository at this point
Copy the full SHA 2b028d3View commit details
Commits on Dec 13, 2023
-
Apply suggestions from code review
Co-authored-by: İnanç Gümüş <inanc.gumus@grafana.com>
Configuration menu - View commit details
-
Copy full SHA for 48833c8 - Browse repository at this point
Copy the full SHA 48833c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac18621 - Browse repository at this point
Copy the full SHA ac18621View commit details -
This log is notifying the user of something that can't be changed or actioned on, so it's better represented as info rather than a warn.
Configuration menu - View commit details
-
Copy full SHA for a13e10d - Browse repository at this point
Copy the full SHA a13e10dView commit details
Commits on Dec 14, 2023
-
Update comment on parseConsoleRemoteObjectValue
This is just to clarify why these empty cases are there.
Configuration menu - View commit details
-
Copy full SHA for 0139348 - Browse repository at this point
Copy the full SHA 0139348View commit details -
Configuration menu - View commit details
-
Copy full SHA for 167d447 - Browse repository at this point
Copy the full SHA 167d447View commit details -
This particular test may run slower on other machines, so accounting for that scenario -- specifically in the CI.
Configuration menu - View commit details
-
Copy full SHA for 1a76aec - Browse repository at this point
Copy the full SHA 1a76aecView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.