Toad World® Forums

Having to "Generate Test Code" after every change...help


#1

Is this expected behavior or do I have some incorrect setting perhaps?

For example, I go and make a change to the expected result (from 1 to 2 for example) in the Outcome portion of a single unit test. When I get back to the Test Definitions listing, I make sure columns Test Definition and Test Code are marked with the green icon indicating that it’s compiled. I run the test and it fails. When I check why it failed, it lists the old expected result (still shows expected result of 1) for the outcome. Then, if I click the “Generate Test Code” option and then re-run the test it succeeds and the expected result reflects my change (now shows expected result 2).

From what I’ve read I was under the assumption the Generate Test Code would run automatically behind the scenes when I make a change to the unit tests.

Thanks in advance.


#2

Barry,

We don’t auto-generate until you try to RUN that test again. It was not at all clear to me that you did that. Making a change and saving it does NOT kick off the test run.

Please clarify.

Thanks, SF


#3

Thanks for the quick reply. Yes, I RUN the test and then on the results screen it has the red icon indicating failure, and when I check the details of the failure I see the expected result is still set to the old value, not the new one. I then hit Generate Test Code, and then subsequently RUN the test and it works as expected with the new expected result set.


#4

I’ll post some screenshots to illustrate what is happening…
screen1.jpeg


#5

I’ll post some screenshots to illustrate what is happening…
screen2.jpeg


#6

Here I run the test and you see it’s still using the old expected value.

edited to add: the second image is to illustrate the everything is marked as compiled.

Message was edited by: BarryD
screen3.jpeg


#7

Here I run the test and you see it’s still using the old expected value.

edited to add: the second image is to illustrate the everything is marked as compiled.

Message was edited by: BarryD
screen4.jpeg


#8

Finally I generate test code, run the same test, and now it has the updated expected value…
screen5.jpeg


#9

Finally I generate test code, run the same test, and now it has the updated expected value…
screen6.jpeg


#10

Thanks so much. This should help me track things down. I might ask for some trace info…

Regards, SF


#11

Sure, whatever you need. I hope to get this solved.

I have email subscribed to this thread so I can respond quickly.


#12

Hmmm. I definitely cannot duplicate with my own test definition. So obviously something else is involved. If you don’t mind, I’d like to shift off the forum to direct email and support.

Could you please send to me at steven.feuerstein@quest.com the following:

  1. What version of Code Tester are you using?

  2. Can you reproduce this problem with a simple program that I can install and try on my instance?

  3. Go through these same steps, but after making the change to the field and before you press Run in Test Builder, turn on tracing without any filtering (click on icon in top left corner of window and choose Start Tracing). Then after you reproduce the problem, dump the contents of the qu_log table (in the CT repository schema) as insert statements to a file, and send that to me.

Thanks, SF


#13

Barry communicated the following to me:

“I have always been clicking Save and Close in the Test Builder Screen and then from the Dashboard I would right-click the Unit Test and do Recompile Test Code and then right click again and do Run Test. When I do it that way, the problem I mentioned occurs.”

And now it all makes sense. You found a way to bypass our automatic regeneration. Here’s how:

We automatically regen when the test code is out of date. But when you choose to explicitly recompile, it resets the timestamp on the unchanged test code so it is no longer out of date. Then when you ask to run, we do not regen.

You have, in effect, created an issue by not just letting CT do all the work for you. :slight_smile:

Simply choose run without the recompile and all should be fine.

We will plug this hole in 1.8.3 - if you ask to recompile, then we will regen first if it is out of date.

Regards, SF


#14

I always did do things the hard way…

Glad we got to the bottom of this, thanks. I marked this as answered.

Cheers,
Barry