Service Virtualization

Expand all | Collapse all

Invoking test cases using Lisa Invoke from  server

Jump to Best Answer
  • 1.  Invoking test cases using Lisa Invoke from  server

    Posted 02-27-2018 01:55 PM

    I have a testcase with only one REST step in it. I need to have this test case hosted on DevTest Server so that anyone can invoke this testcase which is in the server using a url. Could you please help?deoma03



  • 2.  Re: Invoking test cases using Lisa Invoke from  server

    Posted 02-27-2018 02:18 PM

    Varun,

     

    What you would need to do is to create a MarInfo file from your test case and make sure you have all the needed artifacts.  Then create a Mar file from the MarInfo file and deploy it to a Project that the Portal has access to.  The any user log in in to the Portal can run the test case.

     

    What version of DevTest are you on?

     

    ~Marcy



  • 3.  Re: Invoking test cases using Lisa Invoke from  server

    Posted 02-28-2018 01:41 PM

    MarcyNunns     i am using DevTest  10.2 - just migrated from 8.2. Can you please help me on the below two questions.

    1) Creating a MAR file from a test case where should i go and deploy it in Portal?

    2) I tried to run the testcase as Monitor to CVS

          a) Is this a proper way to have the test case run on a server to invoke it using Swagger?

          b) When i deployed the test case (8.2 version) as monitor to CVS it is always in ended state. Could you please  tell me why is it on ended state always. 



  • 4.  Re: Invoking test cases using Lisa Invoke from  server

    Posted 02-28-2018 02:28 PM

    Please refer to this documentation on how to deploy a MAR to a Project on the Portal:

     

    DevTest Portal - DevTest Solutions - 10.2 - CA Technologies Documentation 

     

    As far as DevTest 8.2 CVS Monitor error, without looking at the log files I have no ideal why it is ended state.  So you are saying it does not run at all? Have you tried to deploy to CVS with DevTest 10.2?  That would be best since 8.2 is EOS. Here is the 10.2 for CVS:

     

    Deploy a Monitor to CVS - DevTest Solutions - 10.2 - CA Technologies Documentation 

     

    If you are still having an issue, please feel free to open a Support case.



  • 5.  Re: Invoking test cases using Lisa Invoke from  server

    Posted 02-27-2018 03:12 PM

    Hello Varun,

     

    You can also try to use LISA Invoke and the /CoordinatorServers/{serviceName}/Tests/{testId}/actions/start action to run the test.

     

    1. Deploy a test case to a coordinator via the Workstation
    2. Immediately use : GET /CoordinatorServers/{serviceName}/Tests to get the test ID. This works only as long as the test is running.
    3. Use CoordinatorServers/{serviceName}/Tests/{testId}/actions/start with the test id above.

     

    Heloisa



  • 6.  Re: Invoking test cases using Lisa Invoke from  server

    Posted 02-28-2018 01:50 PM

    deoma03 Thanks Maria the swagger worked in 8.2. But is there a way i can have the test case deployed in server always so that any time anyone can invoke it  using the swagger ? 



  • 7.  Re: Invoking test cases using Lisa Invoke from  server
    Best Answer

    Posted 02-28-2018 04:43 PM

    I suppose you could set up a VSM that knows where the MAR file is located on the VSE server or file share mapped to the VSE server. In theory, anyone could call a Virtual Service using a REST call. The VSM could have an added REST step to fire the LISA Invoke API passing in the MAR file as input.

     

    Using the old school API, the REST call would look something like this:

    http://localhost:1505/lisa-invoke/runMar?marOrMariPath=<PATH_TO_MAR_ON_SERVER>/<marFileName>.mar&async=true

     

    Refer to: Run Model Archives with LISA Invoke - DevTest Solutions - 10.2 - CA Technologies Documentation 

     

    You need to consider the following and maybe more:

    - What happens if two or more users execute the same test at the same time or while a test is already running?

    - How long can the HTTP connection between the consumer and the virtual service be "held open"?  If the test runs too long, can it be executed asynchronously (fire-and-forget) so the service does not have to wait for the test to complete?

    - Where does the test case output report "go"?  If asynchronous, how does the consumer view the pass/fail results?

    - Can the service combine other techniques such as GET /CoordinatorServers/{serviceName}/Tests to include the running test's test ID to respond to the consumer so a subsequent call to check the status can be handled?

    - If parameters need to be passed to the Test, how is that going to happen?

    And so on...  

     

    But, since you say that the test case has only one REST step, why not just embed the REST call in a virtual service.  Allow the virtual service to make the REST call, and store the response from the REST call in the lisa_vse_response.get(0).setBody( "<REST CALL RESPONSE HERE>" );

     

    The consumer calls the virtual service. The service makes the REST call and returns the response to the consumer.