It's all about the answers!

Ask a question

RQM not detecting powershell output number. How do I get this working?


Linda Gray (111) | asked Jan 08 '14, 6:30 p.m.
 Hello All,

I am writing a powershell script to automate testing for my team. It has the ability to run different types of test frameworks and interpret the results into RQM result codes, then just returns those codes. RQM, however, is not detecting those codes and instead looks like it is just setting everything > 0 as 'Failed'. Here is my pseudo-code:

param([string]$framework = "testFramework", [string]$args = "framework arguments needed"])
& $testFramework $args
switch ($LastExitCode)
  {
    0 { exit 0 }
    1 { exit $LastExitCode }
    2 { exit 40 }
    10 { exit 43 }
    11 { exit 44 }
    12 { exit 46 }
    13 { exit 46 }
    default { exit 42 }
  }
Any suggestions to get this working would be great. I followed the tutorial to assign test scripts and grab its output. Unless I missed something, I feel like this may be a bug?!

Thanks!  

Comments
Paul Slauenwhite commented Jan 09 '14, 7:58 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Linda, could you explain how you are integrating with RQM?  Are you using the RQM REST API?  If so, how are you invoking the API?


Linda Gray commented Jan 09 '14, 12:38 p.m.

I created a test script within RQM that runs my powershell script. I am not using any API's since all the testing we are running uses MSTest and Telerik for now. After I get the output from these testing frameworks, which includes various error codes, I exit powershell echoing the equivalent error/pass code to RQM. The appropriate code is displayed within my command prompt and my powershell app.

6 answers



permanent link
Deepa Doraswamy (4712) | answered Jan 13 '14, 6:19 a.m.
JAZZ DEVELOPER
Hi Linda,

Are you using the Command Line Adapter to run these scripts from RQM?

Thanks,
Deepa

permanent link
Linda Gray (111) | answered Jan 13 '14, 11:23 a.m.
 Yes, I am. I have an adapter setup and when I run the Test Case with the test script assigned to it, the tests run as they should. The only issue is the correct output being displayed in RQM.

I have an adapter that is started on my target system.

1. Created Test Script and added my powershell script with the following command parameters:
- Command: PowerShell.exe
- Arguments: "C:\ScriptFolder\MyScript.ps1 -t C:\testDir\Test1.tstest -f MSTest"

2. Created a Test Case that will run this script
3. Once I run the script (locally or remotely), the tests will kick off and after they completed, all RQM reflects is a 0 or 1, I even went in and hacked the exit code to RQM result codes and still always saw a '1' or Failed. I was supposed to see various error codes and did not.

permanent link
Deepa Doraswamy (4712) | answered Jan 14 '14, 6:21 a.m.
JAZZ DEVELOPER
Hi Linda,
Please refer to this article to set the exit codes.

https://jazz.net/library/article/809#MapCodes

Thanks,
Deepa

permanent link
Linda Gray (111) | answered Jan 14 '14, 2:53 p.m.
 I am aware of these codes already, they are in my script. If you reference the code I added in my question you would see them. The problem is RQM is not detecting these codes when my scripts exits with them.

Is there any way I can get proper support on this? This would be faster over the phone or with a ticket? This is a blocking issue for a high priority item.

permanent link
Deepa Doraswamy (4712) | answered Jan 15 '14, 6:49 a.m.
JAZZ DEVELOPER
edited Jan 15 '14, 7:06 a.m.
Hi Linda,
Please raise a PMR.
http://www-01.ibm.com/support/docview.wss?uid=swg21507639
Thanks,
Deepa

permanent link
Deepa Doraswamy (4712) | answered Jan 15 '14, 11:51 a.m.
JAZZ DEVELOPER
With a .bat script, the status of the result is set appropriately in RQM. You could try calling the powershell script from a command line script and return the error code from there. In the RQM Script, call the command line script.

Thanks,
Deepa

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.