Improve cicd test runner and reported

- run pytest code without capturing stderr, to get solid output
  in the Jenkins log
- do not print the error message if something failed,
  it is already shown in the exception message
- add re-tries while getting the job results. Jenkins may return
  'None' for the job workflow right after the job is finished.
- add getting k8s version to utils/env_k8s
- add reporting k8s_conformance suite to TestRail
- increase number of cmp nodes to 4 on k8s cicd envs
- increase memory on k8s cmp nodes from 2Gb to 4Gb
- increase memory on k8s ctl nodes from 2Gb to 8Gb
- enable verbose in k8s_conformance tests

Change-Id: I672279007fe4d7e3d684f0e49d1bcb7ff42a430f
diff --git a/src/com/mirantis/system_qa/SharedPipeline.groovy b/src/com/mirantis/system_qa/SharedPipeline.groovy
index e4779cd..108ee0c 100644
--- a/src/com/mirantis/system_qa/SharedPipeline.groovy
+++ b/src/com/mirantis/system_qa/SharedPipeline.groovy
@@ -2,6 +2,19 @@
 
 import groovy.xml.XmlUtil
 
+def run_sh(String cmd) {
+    // run shell script without catching any output
+    def common = new com.mirantis.mk.Common()
+    common.printMsg("Run shell command:\n" + cmd, "blue")
+    def VENV_PATH='/home/jenkins/fuel-devops30'
+    script = """\
+        set -ex;
+        . ${VENV_PATH}/bin/activate;
+        bash -c '${cmd.stripIndent()}'
+    """
+    return sh(script: script)
+}
+
 def run_cmd(String cmd, Boolean returnStdout=false) {
     def common = new com.mirantis.mk.Common()
     common.printMsg("Run shell command:\n" + cmd, "blue")
@@ -115,6 +128,17 @@
         """)
 }
 
+def update_working_dir() {
+        // Use to fetch a patchset from gerrit to the working dir
+        run_cmd("""\
+            if [ -n "$TCP_QA_REFS" ]; then
+                set -e
+                git fetch https://review.gerrithub.io/Mirantis/tcp-qa $TCP_QA_REFS && git checkout FETCH_HEAD || exit \$?
+            fi
+            pip install -r tcp_tests/requirements.txt
+        """)
+}
+
 def swarm_bootstrap_salt_cluster_devops() {
         def common = new com.mirantis.mk.Common()
         def cookiecutter_template_commit = env.COOKIECUTTER_TEMPLATE_COMMIT ?: env.MCP_VERSION