Verify CAP/DAP requests automatically#599
Merged
ko1 merged 4 commits intoruby:masterfrom Apr 11, 2022
Merged
Conversation
Member
|
I like this idea 👍 |
Member
Could you be more specific? |
Member
Author
|
If you verify the Even if the fix itself may be simple, fixing this will also affect all the recorded raw tests. So I think it's better to do it in another PR. |
Member
Author
ono-max
reviewed
Apr 1, 2022
264f8c5 to
3146782
Compare
ono-max
reviewed
Apr 2, 2022
|
|
||
| def assert_disconnect_result | ||
| def cleanup_reader | ||
| @reader_thread.raise Detach |
ono-max
reviewed
Apr 2, 2022
| send_request 'Runtime.terminateExecution' | ||
| res = find_crt_cdp_response | ||
| assert_cdp_response 'Runtime.terminateExecution', res | ||
| send_cdp_request 'Runtime.terminateExecution' |
Member
There was a problem hiding this comment.
Maybe, I forgot to add cleanup_reader method. Could you add it here, too?
16f36ea to
6f6d41e
Compare
6f6d41e to
ba7a5fd
Compare
Member
Author
|
@ono-max can you give this another look? thx |
Member
|
Great! LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since all protocol responses should be verified except for a few exceptions (e.g. DAP's
stepBack), the verification should be performed automatically. This can prevent situations like #559 (comment) and also make the API easier to use (getting response from the same method call).There are 2 exceptions though. Both of them are DAP requests:
stepBackdoesn't return response "yet".stackTrace's response doesn't match the schema. I think this is something to be fixed in another PR.This refactor can actually centralize those exceptions and make them easier to manage. And sooner or later they should go anyway.