Jump to content

Can't run test case :-(


turtle

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

 

post-95-0-59149300-1302498864_thumb.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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

 

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).

 

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.

 

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.

Link to comment
Share on other sites

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!

Failue_VI_Tester_Project.zip

Success__VI_Tester_Project.zip

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

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:

 

  1. 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.)
  2. 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
  3. 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

Link to comment
Share on other sites

  • 2 years later...

Hi,

 

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

 

  1. 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.)
  2. 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
  3. Only test methods that start with the word "test" (at least this appears to be case-insensitive) are considered test methods.

 

I agree with this list, and last point should really be made clearer to new users, I was hit by this too.

 

By the way, is VI Tester still maintained? A quick browse of the forum shows known bugs, and enhancements that should be straightforward to implement, but the last release is nearly 3 years old...

 

Thanks anyway for making it available!

Link to comment
Share on other sites

I agree with this list, and last point should really be made clearer to new users, I was hit by this too.

 

By the way, is VI Tester still maintained? A quick browse of the forum shows known bugs, and enhancements that should be straightforward to implement, but the last release is nearly 3 years old...

 

Thanks anyway for making it available!

 

Hi Charles! Thanks for the feedback on your getting started experience. I agree that these three things could be improved.

 

Yes, VI Tester is still maintained, minimally at the moment, but (fairly) we'd love to be able to give it even more love than we're able to right now.

 

 

Let's keep the dialog going. It's great to hear that people use/love VI Tester and it motivates all of us at JKI!

Link to comment
Share on other sites

  • 2 months later...

Hi Charles! Thanks for the feedback on your getting started experience. I agree that these three things could be improved.

 

Yes, VI Tester is still maintained, minimally at the moment, but (fairly) we'd love to be able to give it even more love than we're able to right now.

 

 

Let's keep the dialog going. It's great to hear that people use/love VI Tester and it motivates all of us at JKI!

 

I would love to make more use out of VI Tester, but since I'm using LabVIEW 2012 and 2013, the TestCase-From-Template bug that has been posted on the forums by shb causes us a lot of grief making it significantly more awkward to use than NI's UTF. Is there any news on when any updates might be made? Or (dare I ask) the possibility of opening up the VIs to allow the community to make these modest improvements?

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hi Everyone. We just released a new version (1.1.2.274) of VI Tester with a fix for this issue!

 

You can get this new version by checking for package updates with VIPM.

 

 

Thanks for your great feedback and patience. :)

 

Thanks for the update!

Sorry for reporting a problem once again. I'm overall satisfied. But with this release, in the new templates, a very useful comment was removed in "setup": "If references opened in setUp, then keep this frame enabled".

 

The frame contains "wait on testcomplete", effectively mandatory if you rely on opened references, and I removed it, thinking it was related to real-time target (which is the displayed case when you open the diagram). Fortunately I could find what the problem was, but it took me some time!

I was imprudent, but with the previous comment I wouldn't have removed it.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.