Uh oh!
There was an error while loading. Please reload this page.
Add assert locals to protocol tests - #559
Conversation
st0012
commented
Mar 12, 2022
cc @ono-max |
st0012
commented
Mar 12, 2022
And since we now also cover local variables, I think the "raw" tests can be deleted? |
I prefer "assert_local_result expected, variable: nil" to align with other methods. |
|
st0012
commented
Mar 13, 2022
@ono-max how about having both? |
|
st0012
commented
Mar 14, 2022
That's interesting, how does the framework now if we expect |
ono-max
commented
Mar 14, 2022
You might want to read https://github.com/ruby/debug/blob/master/test/support/protocol_utils.rb#L414. |
st0012
commented
Mar 15, 2022
The current value assertion imo isn't practical in the long term. Not passing debug/test/protocol/hover_test.rb Lines 82 to 88 in 12c5ac3 This means that different test cases are not isolated and that'll make future tests harder to write (because we need to know what constants defined by other tests) and harder to debug. |
Right. I agree with your opinion. |
st0012
commented
Mar 19, 2022
@ono-max I don't like the idea that you always own the CDP/DAP test framework and everything to be added needs to be approved by you. Why can't we have this helper first and then you can refactor it when you have a clear idea? You didn't get the framework right the first time with #547, right? It actually broke, which is normal in software development. And you later updated it and it works for all of us now. So why can't I implement the assertion helper this way first and need to wait for your implementation? It's not public API and can always be changed. |
st0012
commented
Mar 19, 2022
@ono-max Simply put: You can and should rethink about If you later want to change it to |
ono-max
commented
Mar 20, 2022
In CDP/DAP tests, @ko1-san doesn't review it, and when PRs are created about changes to the framework, he asks me to review them. That's why I think that I am responsible for them and need to approve them. Although changes to the framework don't affect debugger users, it affects contributors who write tests. Because I want to minimize the impact, I think that I need to decide |
There could be contributors affected by the changes, which is an assumption. But what we surely know now is that we can use Another thing is that, we as software developers don't make things right at the first, 2nd, or even the 3rd try. Trying to make things perfect and align the later implementation is an illusion. And more importantly, this shouldn't be a reason to block other progress. You used the whole #547 PR to implement the framework and helpers, but it didn't workout at all after it's merged. And you didn't even spotted it. No other contributors spotted it either. I spotted it and raised it to you. Because I'm the one who use this framework. You also didn't spot the flaw in the current design, I spotted it, just in the above comments. Because again, I'm the contributor impacted by those issues. So can you stop assuming there's other contributors that may be affected by this, while I, who does write these tests, telling you I'm already affected by the lack of type information and I know and understand that you want to make this framework great. And you did make it great over the time, with mistakes and discussions, like #513. But your responsibility to the framework shouldn't become an excuse to hold it and not letting other people touching it, or ask them to develop with your own pace. This is not your personal project. |
ono-max
commented
Mar 21, 2022
Thank you for explaining to me. |
st0012
commented
Mar 22, 2022
Thank you. And perhaps later we can set rules to infer some value types automatically, like:
So But for matching Ruby objects (e.g. instance of |
| res = find_crt_cdp_response | ||
| actual_locals = res.dig(:result, :result).map do |loc| | ||
| type = loc.dig(:value, :className) || loc.dig(:value, :type).capitalize # TODO: sync this with get_ruby_type |
There was a problem hiding this comment.
Oh, I noticed that this is incorrect. We can't use :type as Ruby class.
I'll fix it later.
Uh oh!
There was an error while loading. Please reload this page.
c44623f to
2b50de2Compare2b50de2 to
de802b7Compareono-max
commented
Mar 23, 2022
Could you add |
st0012
commented
Mar 23, 2022
@ono-max 👍 added |
Uh oh!
There was an error while loading. Please reload this page.
13e828f to
a694b7bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ono-max
commented
Mar 26, 2022
I think that we should support Regexp because we can't use a will be something like |
st0012
commented
Mar 26, 2022
How about |
ono-max
commented
Mar 26, 2022
For me, it's easier to write a regular expression and read it. |
st0012
commented
Mar 26, 2022
Sure, so |
71020cc to
381388cCompareUh oh!
There was an error while loading. Please reload this page.
st0012
commented
Mar 28, 2022
@ono-max I think this is good to merge? |
ono-max
commented
Mar 28, 2022
Almost. You forgot to change my commit suggestions like #559 (comment) or #559 (comment). Maybe, when you rebase this PR, they are removed. |
381388c to
c7f0f54Comparest0012
commented
Mar 28, 2022
Ah right, they must be left during the force push. I've re-added them. |
ono-max
commented
Mar 28, 2022
Great! |
No description provided.