RedHatQE / polarize

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

Don't read in XML description file unless necessary #23

Open rarebreed opened 7 years ago

rarebreed commented 7 years ago

In the processIdentities method, for every method, it will open and read in the matching XML description file to check that the Polarion ID is there. This already takes close to half a minute for a thousand methods because of all the File IO. If polarize is used by teams with tens of thousands of methods, this could add several minutes to the compile time.

Instead of always loading the XML file, check the annotation first. If it does not exist there, then check the mapping file. Only then check the XML description file

rarebreed commented 7 years ago

There is one problem to this approach. If the ID exists in the annotation, it will never be checked/updated in the mapping.json or the XML files.

To address this, a separate utility should be written that will periodically update the mapping.json and XML files. Alternatively, a flag could be introduced to tell the compiler what behavior to do. The flag could specify to run it the current way, or to only check the annotation, mapping, and XML file in that order.

rarebreed commented 7 years ago

An alternative could be to disable annotation processing altogether, and only do it when the developer wants to push the changes to the repo so that upstream can see the generated XML files. By default the flag to do annotation processing can be turned off, and only when set in the config file, the annotation processing will happen. This way regular compiles will be as speedy as before, and only when it needs to generate/edit the XML it will be slower.

Another possible alternative is to only generate XML as needed for import requests, and store all the test definitions in a publicly available database for example an orientdb server.