JKI Discussion Forums
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can't run test case :-( Rate Topic: -----

#1
User is offline   turtle 

  • Group: Members
  • Posts: 4
  • Joined: 08-April 11
Hi all!

I learn VI Tester. I have a problem with run Tast Case. I add MyTestCase.lvclass to project by
manual: http://forums.jki.ne...ting-new-tests/
I run Menu>>Tools>>VI Tester>>Test VIs...
and in Test Hierarchy are not test cases. What do I wrong?

Thank you!
0 kudos

#2
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06

View Postturtle, on 09 April 2011 - 06:17 PM, said:

Hi all!

I learn VI Tester. I have a problem with run Tast Case. I add MyTestCase.lvclass to project by
manual: http://forums.jki.ne...ting-new-tests/
I run Menu>>Tools>>VI Tester>>Test VIs...
and in Test Hierarchy are not test cases. What do I wrong?

Thank you!


Once you have the VI Tester window open, try selecting File >> Open Project of Test Class and then browse to your project (.lvproj) or test case/suite (.lvclass) file. Does that work for you?
0 kudos

#3
User is offline   Omar Mussa 

  • Group: JKI Team
  • Posts: 88
  • Joined: 12-October 06

View Postturtle, on 09 April 2011 - 06:17 PM, said:

What do I wrong?


Try saving the .lvproj file and seeing if the tests appear (relaunch VI Tester UI after saving .lvproj file).
0 kudos

#4
User is offline   turtle 

  • Group: Members
  • Posts: 4
  • Joined: 08-April 11

View PostJim Kring, on 09 April 2011 - 06:54 PM, said:

Once you have the VI Tester window open, try selecting File >> Open Project of Test Class and then browse to your project (.lvproj) or test case/suite (.lvclass) file. Does that work for you?

I try it. It does not work.

And I try save project, and open again, run Tools>>VI Tester>>Test VIs...
It does not work.

I try on 3 configurations:
1) Win 7 64 bit + LabVIEW 10.0f1 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1);
2) Win XP 32 bit (On VMware) + LabVIEW 10.0 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1);
3) Win XP 32 bit + LabVIEW 10.0 32-bit + VI Tester (jki_labs_tool_vi_tester - 1.1.2.164-1, jki_rsc_toolkits_pallette - 1.1-1).

May be something wrong with my project? I place my project in placement.
0 kudos

#5
User is offline   Omar Mussa 

  • Group: JKI Team
  • Posts: 88
  • Joined: 12-October 06

View Postturtle, on 10 April 2011 - 08:25 AM, said:

May be something wrong with my project? I place my project in placement.


Sorry that you're still having trouble. What are your default language settings? It could be a localization issue. My last suggestion if you have time to check this - try downgrading VI tester to the previous version from VIPM (restart LabVIEW after installation) and see if that works.

I'll try to reproduce your issue at work tomorrow (Monday).
0 kudos

#6
User is offline   Omar Mussa 

  • Group: JKI Team
  • Posts: 88
  • Joined: 12-October 06
I think I know what's wrong - its actually a documentation bug in our manual. We refactored the template TestCase object so that when its instantiated, you have a method called 'testExample.vit' (whereas it used to instantiate testExample.vi). The VI Tester frameworks is 'smart' enough to know that .vit files are not meant to be run as tests, so they are not added to the tree. To create a test, right click on the the 'testExample.vit' file and select 'New Method from Template'. Create a name for this method such as 'testXXX.vi' where XXX where XXX is anything you want (example: 'testVITesterUI.vi'). Now that the TestCase actually contains a test, the class will show up on the tree.

Attached Image: NewMethod.png

That should get you past the roadblock. Another option is to open the example project (Help-->Open Example Project) and that will also work.
0 kudos

#7
User is offline   turtle 

  • Group: Members
  • Posts: 4
  • Joined: 08-April 11

View PostOmar Mussa, on 10 April 2011 - 03:46 PM, said:

Sorry that you're still having trouble. What are your default language settings? It could be a localization issue. My last suggestion if you have time to check this - try downgrading VI tester to the previous version from VIPM (restart LabVIEW after installation) and see if that works.

I'll try to reproduce your issue at work tomorrow (Monday).


Yes, I install VI Tester previous version 1.1.1.137-1, and trouble is absent.

I have all hosts with default Russian locale (1251).

At Last version 1.1.2.164-1, if I do "testExample.vit>>context menu>>new form template" testExample.vi appear in project. But I still having a trouble.
Last version VI Tester (after update) work correctly with my project, created by previous version VI Tester.

Thank You for Help!
0 kudos

#8
User is offline   Omar Mussa 

  • Group: JKI Team
  • Posts: 88
  • Joined: 12-October 06

View Postturtle, on 11 April 2011 - 01:15 PM, said:

Yes, I install VI Tester previous version 1.1.1.137-1, and trouble is absent.


That's great! I'm glad you're making progress. So, the reason for this is that we changed the way VI Tester works - it used to load the test classes into memory to find the test methods. This was very slow for large projects, so we changed the code to discover test methods by inspecting the class on disk. We need a warning flag if you try to load a TestCase with unsaved changes as it may not show up in your test list (Added to 'Known issues': Case 10770). Note - once discovered, you can edit the code within the tests while the VI Tester UI is open without any issues - this is just a load time effect.

View Postturtle, on 11 April 2011 - 01:15 PM, said:

I have all hosts with default Russian locale (1251).

Can you attach your custom TestCase.lvclass file to this thread? I want to ensure that we don't have a localization issue that would affect you (or other users).

View Postturtle, on 11 April 2011 - 01:15 PM, said:

At Last version 1.1.2.164-1, if I do "testExample.vit>>context menu>>new form template" testExample.vi appear in project. But I still having a trouble.

What trouble are you having? Make sure the TestCase is saved after you add the testExample.vi.

View Postturtle, on 11 April 2011 - 01:15 PM, said:

Thank You for Help!


Thanks for your patience! I'm pretty confident that you'll be able to run unit tests without any issues once you get past these initial hurdles.
0 kudos

#9
User is offline   turtle 

  • Group: Members
  • Posts: 4
  • Joined: 08-April 11

View PostOmar Mussa, on 12 April 2011 - 12:04 AM, said:

Can you attach your custom TestCase.lvclass file to this thread? I want to ensure that we don't have a localization
issue that would affect you (or other users).

Yes, see in attachments "Failue_VI_Tester_Project.zip".

My fault: I don't save project after do "testExample.vit>>context menu>>new from template". If save project, VI
Tester finds test case "test Example 2.vi". This is "Success_VI_Tester_Project.zip".

Best Regards!

Attached File(s)


0 kudos

#10
User is offline   Omar Mussa 

  • Group: JKI Team
  • Posts: 88
  • Joined: 12-October 06

View Postturtle, on 12 April 2011 - 12:10 PM, said:

My fault: I don't save project after do "testExample.vit>>context menu>>new from template". If save project, VI
Tester finds test case "test Example 2.vi".


Good to know. We'll definitely look into adding warnings about unsaved changes to the .lvclasses, as this is a usability issue. What we are trying to do is avoid loading the .lvclass into memory unnecessarily - it adds a lot of time depending on your class hierarchy, size, etc. But ideally, this should be transparent to VI Tester users. Thanks for your help. Please post more feedback as you use the product.
0 kudos

#11
User is offline   Rob Calhoun 

  • Group: Members
  • Posts: 5
  • Joined: 20-January 09

View PostOmar Mussa, on 12 April 2011 - 12:04 AM, said:

That's great! I'm glad you're making progress. So, the reason for this is that we changed the way VI Tester works - it used to load the test classes into memory to find the test methods. This was very slow for large projects, so we changed the code to discover test methods by inspecting the class on disk.


This is a funny (well, sad, really) thing about LabView these days; walking the project hierarchy is mind-bogglingly slow. We wrote a quick-drop-like tool (before quick drop) for user VIs. We used to scan the project hierarchy so we could properly assign each VI to a project and ignore irrelevant ones, but it was hundreds of times faster to simply do a recursive filesystem search for all labview files below the .lvproj file, so we switched to that.
0 kudos

#12
User is offline   Rob Calhoun 

  • Group: Members
  • Posts: 5
  • Joined: 20-January 09

View PostOmar Mussa, on 12 April 2011 - 04:00 PM, said:

Good to know. We'll definitely look into adding warnings about unsaved changes to the .lvclasses, as this is a usability issue. What we are trying to do is avoid loading the .lvclass into memory unnecessarily - it adds a lot of time depending on your class hierarchy, size, etc. But ideally, this should be transparent to VI Tester users. Thanks for your help. Please post more feedback as you use the product.


Here are three things that make the VI Tester behave in unexpected ways to a new user:

  • Test Cases that do not have any test methods do not appear in VI Tester hierarchy. (Maybe this is a feature, but it's not what I would expect.)
  • After creating and saving a new test method the Test Case still does not appear in the VI Tester hierarchy. This is because the Test Case (class) has not been saved, so it still has no test methods from the point of the VI Tester
  • Only test methods that start with the word "test" (at least this appears to be case-insensitive) are considered test methods.


The first of these should get fixed; the hierarchy should show the Test Case even if it has no methods.

The second is a design flaw in LabView that causes no end of trouble. LabView classes have this irritating behavior of being both cross-referenced (a method knows it is part of a class, and a class knows it is part of a member) AND comprised of multiple files thus requiring multiples save operations. Not only is it causing trouble here, the design makes it is easy to quit LabView with the class in an inconsistent state.

Back to the VI Tester. I can't figure out the logic behind the third item above. I agree it's a convention, and conventions are good, but when would you want a method that is a method of a Test Case class, but not one of {setUp|tearDown|testMethod}? If this is desired (I can accept there are valid use cases), is there a less quirky implementation? This one is not very friendly to non-English speakers (or English-speaking newbies, for that matter.)

I was kicking around whether one could solve this by making Test Methods from a dynamically dispatched template, but that doesn't really solve anything. Anyway, the name requirement needs to be spelled out in bold face type. At present the VI Tester is quite frustrating to use at first because it's hard to figure out what you need to do to make a test that will be recognized. (I could run the example tests, but I couldn't run any of my own!)

-Rob
0 kudos

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic