Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 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!  

0 votes

Comments

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?

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
Hi Linda,

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

Thanks,
Deepa

0 votes


Permanent link
 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.

0 votes


Permanent link
Hi Linda,
Please refer to this article to set the exit codes.

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

Thanks,
Deepa

0 votes


Permanent link
 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.

0 votes


Permanent link
Hi Linda,
Please raise a PMR.
http://www-01.ibm.com/support/docview.wss?uid=swg21507639
Thanks,
Deepa

0 votes


Permanent link
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

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Jan 08 '14, 6:30 p.m.

Question was seen: 5,104 times

Last updated: Jan 15 '14, 11:51 a.m.

Confirmation Cancel Confirm