Products

03. December: Santa’s Elf decided to improve gifts QA by using the new REST API

By Felicitas Kreutzer

The joy of Christmas often revolves around the spirit of giving and receiving gifts. While most people hope for a positive and delightful experience during this festive season, a defective present has the potential to dampen the holiday spirit. This year, Santa’s Elf decided to improve gifts QA by using the new REST API endpoints available in Polarion 2310 to import automated CI / CD Test Results from Gitlab in Polarion!
 
As part of his busy Pipeline, Santa added a .post job that creates a Test Run and imports xUnit Test results.
 
update-polarion:
  stage: .post
  script:
    – ‘curl -X POST “$POLARION_SERVER/rest/v1/projects/$POLARION_PROJECT/testruns” -H  “accept: application/json” -H  “Authorization: Bearer $POLARION_TOKEN” -H  “Content-Type: application/json” -d “{\”data\”:[{\”type\”:\”testruns\”,\”attributes\”:{\”id\”:\”$CI_PROJECT_TITLE $CI_PIPELINE_ID\”,\”groupId\”:\”$CI_PROJECT_TITLE $CI_PIPELINE_ID\”,\”title\”:\”Title\”,\”type\”:\”automated\”,\”selectTestCasesBy\”:\”automatedProcess\”,\”useReportFromTemplate\”:true},\”relationships\”:{\”template\”:{\”data\”:{\”type\”:\”testruns\”,\”id\”:\”$POLARION_PROJECT/xUnit Build Test\”}}}}]}”‘
 
    – ‘curl -X POST “$POLARION_SERVER/rest/v1/projects/$POLARION_PROJECT/testruns/$CI_PROJECT_TITLE%20$CI_PIPELINE_ID/actions/importXUnitTestResults” -H  “accept: application/json” -H  “Authorization: Bearer $POLARION_TOKEN” -H  “Content-Type: application/octet-stream” -d @testresults.xml’
 
Now, Santa can check the quality of presents and make sure Xmas will go smoothly for everybody!

Special Thanks to Stephane Vayssier!

Special Thanks to Stephane Vayssier!

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/polarion/03-december-santas-elf-decided-to-improve-gifts-qa-by-using-the-new-rest-api/