Forum Discussion

allenj2020's avatar
allenj2020
Contributor
10 years ago

Can I run an individual test item or group from a distributed Task?

I have a project with hundreds of test items in groups.  Each Test calls the same procedure, with a different parameter to pull the test data and actions from an external CSV file.

 

I've now set up a new master project, and want to start distributing these individual tests and groups of tests to different remote machines so I can run them in parallel.  Is this possible?

 

I've gotten my Task defined in my master NetworkSuite, and verified against the host machine and individual slave project I want.

But in the Test field, I don't see any way to pick test items or groups, 

The only examples in the Help reference keyword tests, procedures, and the entire project.

 

e.g. my slave project name is inSight, and I have a test group Shipping with multiple tests.  I want to have a task that calls something like "inSight\Shipping" or "inSight\Shipping\Shippable Items"

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It sounds to me like this is a candidate for consolidating everything into a single test that is parameterized based upon a table.  Rather than having hundreds of test items, you could have one test item with a parameter the runs an SQL query on a CSV file to pull out a subset of tests.  Consider a minor redesign of your project on those lines as I'm not sure how to run based upon a group.

    The other option would be to create multiple "parent" test items as your group place holders, have them log a simple bit of "This is group XXXX" and then have the appropriate test items attached as child items under that.  You should then be able to run the parent and the child ones will execute.  Personally, this feels like a lot of work that can be handled by simplifying the whole project.

    • allenj2020's avatar
      allenj2020
      Contributor

      Hi Robert,

       

      In the Jobs list, I don't see a way to define a job to reference an individual test item either, or to pass a parameter to one.

      (where 'test item' is defined as an those in the Test Items tab of the Project).

      In the Test lookup, the only thing I can find are procedures in the project.

       

      To make that work, I would have to define a different procedure for each group, that internally calls the list of tests (csv files) in that group.  That's certainly possible if it's the only way to do it, but would involve some structural rework, especially since I have some custom code in GeneralEvents_OnStopTest that relies on Project.TestItems references.

       

      If there was a way to launch Test Items directly from scripts I could define a procedure for each group, but that doesn't seem to be supported. 

       

      Still thinking...

       

      Allen

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        How about a single slave project that includes a routine or something that first of all queries the machine name and then, based upon the machine name, executes a particular set of tests? Yes, this would take some restructuring, but I think it would, over all, be less complicated.  What you would do, then, is have the main routine of the project use a DDT object that would execute an SQL query against your CSV file, that SQL query altered based upon the machine name.  So, Machine1 would get all tests where GroupName = "Machine1", Machine2 would get all tests where GroupName = "Machine2" and so on.

         

        Execute that slave project on your slave machines.. they are now context-aware..., they know what machine they are running on and will then execute any tests you need to.  What this would mean is that the slave project, instead of having a whole list of test items, would ahve a single test item that would call your test, parameterized based upon machine name.

        Given time, I could write up the code for you but, perhaps, this will trigger some thoughts so you can fiddle with it yourself?