Skip to content

refactor version-control and runtest.sh script

Thomas Haller requested to merge th/runtest-cleanup-1 into main
  • remove "run/gsm_hub.sh" and move the code inside "run/runtest.sh". This script was only called from there, so splitting out into a separate file does not help to make it easier to understand. Especially, beause "run/gsm_hub.sh" required all the right environment variables from runtest.sh and tainted the environment of the calling script (as it got sourced). If gsm_hub.sh would have been self contained, could have been used alone, and would not mess with the environment of the calling script (that is, not being sourced), it might make sense as separate script. But this way not. Also, in the future we want to strip away stuff from runtest.sh. This special casing of gsm tests is not right. We should run tests by behave alone, and remove as much code as we can from runtest.sh.

  • move version_control.py script to nmci/helpers directory. It's the better place, and only an implementation detail. It makes little sense to concern users with this.

  • move most of the logic from version_control.py to nmci.misc. Also add unit tests for it. This way the code becomes reusable, and can be unit tested.

  • refactor the output of version_control.py. It now also detects the feature file. That code to find the feature file is already in nmci.misc, and it's needed there. Previously it was also duplicated in runtest.sh and gsm_hub.sh.

Merge request reports