<div dir="ltr">Hi Luciano, Juan,<div> using the same test instance to debug breaks the "test isolation" rule, can bring problems if the test is not well written, etc. </div><div> I think that if you have test data that you want to use to debug a test you could put that data in class variables or something like that, not in instance variables. Would that work for you? Or you can apply the change you suggest for the test cases that you want that behavior, I mean redefine #debug as you suggested in your .cs for the test case you want that behavior.</div><div> I think it is not a good idea to use that behavior for all test cases.</div><div><br></div><div> Regarding the test runner, I usually run the tests with cmd+t not the test runner, but it makes sense what you suggest to open the debugger in that case.</div><div><br></div><div>Cheers!</div><div>Hernan.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 16, 2022 at 10:16 AM Juan Vuletich <<a href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Luciano,<br>
<br>
On 8/15/2022 6:48 AM, Luciano Notarfrancesco via Cuis-dev wrote:<br>
> I have subclasses of TestCase that hold more state besides the test <br>
> selector. For example I have a subclass with a 'seed' instance <br>
> variable that is set randomly in >>#initialize, and a 'random' <br>
> instance variable that is set to 'Random seed: seed' in >>#setUp. This <br>
> allows me to write tests that use randomness and are reproducible. But <br>
> when debugging a test that failed, a new TestCase instance is created <br>
> and the new TestCase is debugged instead, so the original seed is lost <br>
> and my tests are not reproducible. I'm also experimenting with generic <br>
> tests, for example I have a generic VectorSpaceTest with an instance <br>
> variable 'scalars' for the coefficients field, so I can create a test <br>
> suit with tests for vector spaces over the rationals, Z/pZ, rational <br>
> functions, etc (vector spaces over different 'scalars'), but again the <br>
> scalars are lost when I try to debug a test. I don't see any reason to <br>
> create new instances of the test cases when debugging, see the <br>
> attached change set and let me know if you agree with it.<br>
<br>
I'd defer to Hernán and others who may have an opinion. I don't know if <br>
reusing the test instance could bring problems. Besides, any test I <br>
write is repeatable, setting Random seeds as needed. I guess you must <br>
have your reasons to do otherwise...<br>
<br>
> Also, when a test was taking too long I used to click the stop button <br>
> in the test runner and a debugger would open, so I what it was doing. <br>
> But now the test runner just stops without opening a debugger.<br>
<br>
Maybe you were doing cmd-. to interrupt the process? I don't remember <br>
[stop] opening a debugger. It is easy to do, though:<br>
<br>
terminateRun<br>
running debugWithTitle: 'Interrupted Test'<br>
<br>
If people agree, I can integrate this change.<br>
<br>
><br>
> Thanks,<br>
> Luciano<br>
<br>
Cheers,<br>
<br>
-- <br>
Juan Vuletich<br>
<a href="http://cuis.st" rel="noreferrer" target="_blank">cuis.st</a><br>
<a href="http://github.com/jvuletich" rel="noreferrer" target="_blank">github.com/jvuletich</a><br>
<a href="http://researchgate.net/profile/Juan-Vuletich" rel="noreferrer" target="_blank">researchgate.net/profile/Juan-Vuletich</a><br>
<a href="http://independent.academia.edu/JuanVuletich" rel="noreferrer" target="_blank">independent.academia.edu/JuanVuletich</a><br>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" rel="noreferrer" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a><br>
<a href="http://linkedin.com/in/juan-vuletich-75611b3" rel="noreferrer" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a><br>
<a href="http://twitter.com/JuanVuletich" rel="noreferrer" target="_blank">twitter.com/JuanVuletich</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="font-size:xx-small;border-collapse:collapse"><div style="font-size:small"><a href="https://10pines.com/" style="font-family:Roboto,Helvetica,Arial,sans-serif;font-size:medium" target="_blank"><img width="108" src="https://10pines.github.io/email-signature/10pines-firma@2x.png" style="margin-bottom: 0.5em;"></a><span style="color:rgb(0,0,0);font-family:Roboto,Helvetica,Arial,sans-serif;font-size:medium"></span><h1 style="margin:0px;font-size:14px">Hernán Wilkinson</h1><h2 style="margin:0px 0px 1em;font-size:14px;color:rgb(100,100,100)">Software Developer & Coach</h2><p style="margin:0px;color:rgb(100,100,100);font-size:12px">Alem 896, Floor 6, Buenos Aires, Argentina</p><p style="margin:0px;color:rgb(100,100,100);font-size:12px">+54 11 6091 3125</p><p style="margin:0px;color:rgb(100,100,100);font-size:12px">@HernanWilkinson</p></div></span></div></div>