RedHatQE / polarize

GNU General Public License v3.0
2 stars 2 forks source link

Add JSON parsing so that we can add this as a REST based microservice #39

Closed rarebreed closed 7 years ago

rarebreed commented 7 years ago

I already have a JSON based version of the config file:

{
     "base-dir": "",
     "author": "stoner",
     "mapping": "{basedir}/mapping.json",
     "testcases-xml": "{basedir}/testcases",
     "project": "",
     "project-name": "",
     "group-id": "",
     "edit-config": "",
     "testcase": {
         "prefix": "",
         "suffix": "",
         "importer-enabled": false,
         "timeout": 300000,
         "file": "/tmp/testcases.xml",
         "selector-name": "rhsm_qe",
         "selector-val": "testcase_importer"
     },
     "xunit": {
         "new": "/tmp/modified-testng-polarion.xml",
         "file": "{base-dir}/test-output/testng-polarion.xml",
         "importer-enabled": true,
         "timeout": 3000000,
         "selector-name": "rhsm_qe",
         "selector-val": "xunit_importer"
     },
     "testrun": {
         "template-id": "sean toner master test template",
         "title": "RHSM TestRun for RHEL 7.4 Server x86_64",
         "id": "RHSM TestRun for RHEL 7.4 Server x86_64 NOV-8-2016-14-32-10",
         "dry-run": false,
         "set-finished": true,
         "include-skipped": true
     },
     "properties": [
         {
             "name": "plannedin",
             "val": "RHEL_7_4 Planning"
         },
         {
             "name": "jenkinsjobs",
             "val": "http://path/to/jenkins/job"
         }
     ],
     "servers": [
         {
             "name": "polarion",
             "user": "ci-user",
             "password": "password",
             "url": "http://path/to/polarion"
         },
         {
             "name": "kerb",
             "user": "user",
             "password": "password"
         }
     ]
}

I can marshall this JSON into an Opts class already. What needs to be done now is essentially convert the Opts object to its equivalent Config object and then marshall that

rarebreed commented 7 years ago

This will come in more handy in conjunction with an xunit importer converter. Teams might have an xunit file already, but it doesn't have the requisite data inside it (eg, the mapping of the method to the Polarion ID).

If a team can supply a mapping JSON file in the format that polarize likes, then we can merge the information together to generate the XUnit file as long as we all have this config file. In other words, there are 3 pieces to this puzzle:

  1. A generic xunit file
  2. A mapping file which links a test method to its Polarion ID
  3. A config file, to put in other relevant information into the xunit file (like template-id and project)
rarebreed commented 7 years ago

Work on this will go into byzantine. it will also support YAML as well as JSON.