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

How can we trigger a test run via script?

Hello all!

We use RQM 2.0 (stand-alone, no RTC.)
How can we tell RQM that our build is ready for testing?
I think what suits best would be a script which causes RQM to create an execution schedule.
Our current build system is Hudson + MS Build.
Could we do this with the URL Utility?

regards

0 votes



18 answers

Permanent link
Hello all!

We use RQM 2.0 (stand-alone, no RTC.)
How can we tell RQM that our build is ready for testing?
I think what suits best would be a script which causes RQM to create an execution schedule.
Our current build system is Hudson + MS Build.
Could we do this with the URL Utility?

regards


I would be interested in the answer to the above questions too. Thanks!

0 votes


Permanent link
Hello all!

We use RQM 2.0 (stand-alone, no RTC.)
How can we tell RQM that our build is ready for testing?
I think what suits best would be a script which causes RQM to create an execution schedule.
Our current build system is Hudson + MS Build.
Could we do this with the URL Utility?

regards


Yes, you could use the URL Utility (or the REST API directly) to create a test phase in your test plan or a test execution record(s). See https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op.

0 votes


Permanent link
So I tried this in RQM 3.0, where I would have the execution schedule associated with a build definition and manually create build records for that definition. When I marked the build record complete the execution schedule ran. I also tried this via REST API in 3.0 and it worked.

The idea is this:

1) Create build definition and associate with execution schedule
2) Use REST API to create build record but have build record status and state as the unassigned key.
3) Use REST API to PUT build definition containing link to build record from step 2.
4) Use REST API to PUT build record but with completed state and status of ok.

The states and status use keys specific to RQM. The easiest way to see these is to do this through the WebUI and between each step do a GET request on the buildrecord.

I tried these steps in RQM 2.0.1.1iFix2 and I think they would have worked, but my iFix2 environment is having other issues which prevented me from fully seeing this work in iFix2.

Also here are some work items that are related and should happen in future RQM releases:

https://jazz.net/jazz02/resource/itemName/com.ibm.team.workitem.WorkItem/24274

https://jazz.net/jazz02/resource/itemName/com.ibm.team.workitem.WorkItem/39955

0 votes


Permanent link
I tried these steps in RQM 2.0.1.1iFix2 and I think they would have worked, but my iFix2 environment is having other issues which prevented me from fully seeing this work in iFix2.



This will work in iFix2. It won't work in iFix1 due to the defect that I found and they fixed.
http://jazz.net/jazz02/web/projects/Rational%20Quality%20Manager#action=com.ibm.team.workitem.viewWorkItem&id=44685

Curious what are you writing in? I am using VB.NET at the moment.

Also I see a strange behavior with the build definitions. If you don't manually assign a build record to a build definition first. It appears that all future build records look like they are assigned to that build defnition automatically. I haven't searched to see if the bug is submitted on this yet.

0 votes


Permanent link
I'm writing in Java but when experimenting with this issue I was using FireFox poster plugin.

Also for the issue you mentioned about build records incorrectly showing under the build definitions. I believe that's only a UI issue and it sounds like the same defect I've already submitted:

https://jazz.net/jazz02/resource/itemName/com.ibm.team.workitem.WorkItem/47905

0 votes


Permanent link
So I tried this in RQM 3.0, where I would have the execution schedule associated with a build definition and manually create build records for that definition. When I marked the build record complete the execution schedule ran. I also tried this via REST API in 3.0 and it worked.

The idea is this:

1) Create build definition and associate with execution schedule
2) Use REST API to create build record but have build record status and state as the unassigned key.
3) Use REST API to PUT build definition containing link to build record from step 2.
4) Use REST API to PUT build record but with completed state and status of ok.


I wrote some sample VB.NET code that does this via the REST API. I have only tested it under RQM 2.0 IFIX 2.
You can find it at https://github.com/jameseisenhauer/RQMAPI_BUILD_VB_Sample

Its a little sloppy but it works.

0 votes


Permanent link
Hi kurtism & jameseisenhauer,

We're having a few problems with our set-up. We're on RQM 2.0.1.1 iFix2 and have everything setup by ways of automating the creation/updating of Build Definitions and Build Records.

However, we simply can't get the Execution Schedule to trigger. The Test Suite associated with the Execution Schedule is invoking a very simple Command Line Adapter based test and works fine when invoked manually.

I suspect the clue is in the precise order of creating the Build artefacts. However, when this all relates to Manual tests they hop onto the Execution Console just fine.

I would appreciate it if you (and other subscribers) could spell out the exact steps and which elements in the XML need to change and to what. Here is what we are doing:

1. Create Build Definition via Web UI. Gave it a name but nothing else before Save.

2. POST Build Record which returns the slug__ ID in the Content_Header*. Name=<something>, Build State=<empty>, Build Status=<empty>, Completion Time=<empty>

3. GET Build Definition using urn: ID found on Web UI

4. Update Build Definition by adding Build Record to href> list. The Build Record slug__ ID is used.

5. GET Build Record using slug__ ID. This creates the XML file for updating the content.

6. PUT Build Record with Build State=In Progress, Build Status=Running, Completion Time=Empty

~pause to emulate waiting for a build :D ~

7. PUT Build Record with a Build State=OK, Build Status=Complete, Completion Time=<current>

8. PUT Build Definition with a Build Status=OK {I did this as a last attempt a getting this working}

*we added the POST feature to our copy of the RQMURLUtility.jar

Please could you clarify what you did?

Thanks jameseisenhauer for posting your VB. I've dissected it to find some clues but can't see how we're doing anything different.

I guess, perhaps, this just happens to be a bug in V2.0.1.1 iFix2 but haven't seen anything. In the meantime I am going to try this on V3.0.1 (when I have a chance) to see if there's a difference

Thanks

So I tried this in RQM 3.0, where I would have the execution schedule associated with a build definition and manually create build records for that definition. When I marked the build record complete the execution schedule ran. I also tried this via REST API in 3.0 and it worked.

The idea is this:

1) Create build definition and associate with execution schedule
2) Use REST API to create build record but have build record status and state as the unassigned key.
3) Use REST API to PUT build definition containing link to build record from step 2.
4) Use REST API to PUT build record but with completed state and status of ok.

The states and status use keys specific to RQM. The easiest way to see these is to do this through the WebUI and between each step do a GET request on the buildrecord.

I tried these steps in RQM 2.0.1.1iFix2 and I think they would have worked, but my iFix2 environment is having other issues which prevented me from fully seeing this work in iFix2.

Also here are some work items that are related and should happen in future RQM releases:

0 votes


Permanent link
Your steps seem correct. I've seen this work in RQM 3.0.1, but when I tried in RQM 2.0.1.1 iFix2 it didn't work. But at the time I was running in a development environment that had some other issues, so it wasn't clear to me if it was a bug or just my environment. It's starting to look like a bug and feel free to file one. But I'm pretty sure it works in RQM 3.0.1 and if you have plans to move to RQM 3.0.1 then you'll be okay at that time.

0 votes


Permanent link

The idea is this:

1) Create build definition and associate with execution schedule
2) Use REST API to create build record but have build record status and state as the unassigned key.
3) Use REST API to PUT build definition containing link to build record from step 2.
4) Use REST API to PUT build record but with completed state and status of ok.

The states and status use keys specific to RQM. The easiest way to see these is to do this through the WebUI and between each step do a GET request on the buildrecord.

I tried these steps in RQM 2.0.1.1iFix2 and I think they would have worked, but my iFix2 environment is having other issues which prevented me from fully seeing this work in iFix2.


This thread has been a big help so far...

I am using RQM 2.0.1.1 iFix1. I nearly have this working but for some reason I am unable to update the 'State' of the Build Record with the REST API. The build record needs both Status=OK and State=Complete for the Execution Schedule to run, however State won't update. Here is my XML:

<?xml version="1.0" encoding="UTF-8" ?>

<buildrecord xmlns="http://jazz.net/xmlns/alm/qm/v0.1/">
<title xmlns="http://purl.org/dc/elements/1.1/">build record title</title>
<description xmlns="http://purl.org/dc/elements/1.1/" />
<creator xmlns="http://purl.org/dc/elements/1.1/">creatorname</creator>
<owner xmlns="http://jazz.net/xmlns/alm/v0.1/">ownername</owner>
<state>com.ibm.rqm.buildintegration.buildstate.complete</state>
<starttime>2011-07-12T19:30:36.877Z</starttime>
<endtime>2011-07-12T19:30:50.877Z</endtime>
<status>com.ibm.rqm.buildintegration.buildstatus.ok</status>
<providerTypeId>com.ibm.rqm.buildintegration.common.manualProvider</providerTypeId>
</buildrecord>


If I manually set the build record State to "Complete", my Execution Schedule will kick off moments later as expected. However, manual is not what I am after.

Do I have the syntax for <state> incorrect or is this a defect that I need to move to a later iFix for?

0 votes


Permanent link
Hi,


This thread has been a big help so far...


I agree this is a very useful thread in so many ways


I am using RQM 2.0.1.1 iFix1. I nearly have this working but for some reason I am unable to update the 'State' of the Build Record with the REST API. The build record needs both Status=OK and State=Complete for the Execution Schedule to run, however State won't update. Here is my XML:

If I manually set the build record State to "Complete", my Execution Schedule will kick off moments later as expected. However, manual is not what I am after.

Do I have the syntax for <state> incorrect or is this a defect that I need to move to a later iFix for?


Thanks for the knowledge that a manual kick of the State works for you. That's very helpful.

As far as syntax this look good. In V2.0.1.1 iFix2 this seems to work i.e.: State and Status change when we use a PUT of the Build Record.

rschoessler: please could you clarify your sequence of events e.g.: Build Definition to adding the Build Record and what the State of your Build Definition is at all points especially when you do the PUT of the Build Record and the subsequent State change of the Build Record you mentioned. Thanks

I will get back to the thread later when I've put some of your knowledge into practise on our environment. Thanks again.

0 votes

1–15 items
page 1of 1 pagesof 2 pages

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

Question asked: Feb 25 '11, 2:09 p.m.

Question was seen: 25,597 times

Last updated: Sep 10 '13, 9:21 a.m.

Confirmation Cancel Confirm