vipm-io / vi-tester

VI Tester for LabVIEW
BSD 3-Clause "New" or "Revised" License
28 stars 26 forks source link

VI Tester API - Run Tests (Path Array).vi does not exclude non-test classes. #48

Open samsharp99 opened 4 years ago

samsharp99 commented 4 years ago

Another issue with running tests as part of a CI pipeline.

I am specifying tests to run by pointing to my 'Unit Tests' folder. This folder also contains non-Test Case/Suite classes related to testing (e.g. a mock object). Having the mock object in the folder hierarchy causes the execution of the unit tests to fail.

Reproduction:

Possible reason(s):

LabVIEW: Bad type cast. LabVIEW cannot treat the run-time value of this LabVIEW class as an instance of the given LabVIEW class.



### Proposed Solution
Either:
1) Modify Load Test Case from File.vi to return an array of test objects and to return an empty array if the class is not a test object.

Load Test Case from File.vi
![image](https://user-images.githubusercontent.com/7469882/70130225-12789380-1678-11ea-9f59-4660eb782d88.png)

Run Tests (Path Array).vi
![image](https://user-images.githubusercontent.com/7469882/70130319-3b992400-1678-11ea-86cd-e72bc704ca05.png)

2) Modify Run Tests (Path Array).vi to conditionally index only Unit Test Cases:
![image](https://user-images.githubusercontent.com/7469882/70130487-8b77eb00-1678-11ea-874e-93eb5f33dc9c.png)
jimkring commented 2 years ago

@samsharp99 I haven't looked yet, but is there a unit test to validate the fix?

It's not strictly required, but it might be good to start including a unit test for issues, so that we can eat our own dog food :)

We could organize them like this:
./source/Tests/Fixes/Issue 000048 - Run Tests (Path Array) does not exclude non-test classes.vi