<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18825">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">selftest: Aff test to verify junit xml report<br><br>Change-Id: I8cad02abe776cc00b513113dbaf3c948ea7956cd<br>---<br>A selftest/report_test/_prep.py<br>A selftest/report_test/main.conf<br>A selftest/report_test/report_test.err<br>A selftest/report_test/report_test.ok<br>A selftest/report_test/report_test.py<br>A selftest/report_test/resources.conf<br>M src/osmo_gsm_tester/core/suite.py<br>7 files changed, 208 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/25/18825/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/selftest/report_test/_prep.py b/selftest/report_test/_prep.py</span><br><span>new file mode 120000</span><br><span>index 0000000..9cea3fe</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/_prep.py</span><br><span>@@ -0,0 +1 @@</span><br><span style="color: hsl(120, 100%, 40%);">+../_prep.py</span><br><span>\ No newline at end of file</span><br><span>diff --git a/selftest/report_test/main.conf b/selftest/report_test/main.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e69de29</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/main.conf</span><br><span>diff --git a/selftest/report_test/report_test.err b/selftest/report_test/report_test.err</span><br><span>new file mode 100644</span><br><span>index 0000000..e69de29</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/report_test.err</span><br><span>diff --git a/selftest/report_test/report_test.ok b/selftest/report_test/report_test.ok</span><br><span>new file mode 100644</span><br><span>index 0000000..6e62244</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/report_test.ok</span><br><span>@@ -0,0 +1,79 @@</span><br><span style="color: hsl(120, 100%, 40%);">+cnf ResourcesPool: DBG: Found main configuration file in  /home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/main.conf which is /home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/main.conf</span><br><span style="color: hsl(120, 100%, 40%);">+cnf ResourcesPool: DBG: MAIN CONFIG:</span><br><span style="color: hsl(120, 100%, 40%);">+{'default_suites_conf_path': '/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/default-suites.conf',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'defaults_conf_path': '/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/defaults.conf',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'resource_conf_path': '/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/resources.conf',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'scenarios_dir': ['/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/scenarios'],</span><br><span style="color: hsl(120, 100%, 40%);">+ 'state_dir': '/var/tmp/osmo-gsm-tester/state',</span><br><span style="color: hsl(120, 100%, 40%);">+ 'suites_dir': ['/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/suites'],</span><br><span style="color: hsl(120, 100%, 40%);">+ 'trial_dir': '/home/pespin/dev/sysmocom/git/osmo-gsm-tester/selftest/report_test/trial'}</span><br><span style="color: hsl(120, 100%, 40%);">+tst suiteA: DBG: {combining='config'}</span><br><span style="color: hsl(120, 100%, 40%);">+tst {combining_scenarios='config'}: DBG: {definition_conf={}}  [suiteA↪{combining_scenarios='config'}]</span><br><span style="color: hsl(120, 100%, 40%);">+tst suiteB: DBG: {combining='config'}</span><br><span style="color: hsl(120, 100%, 40%);">+tst {combining_scenarios='config'}: DBG: {definition_conf={}}  [suiteB↪{combining_scenarios='config'}]</span><br><span style="color: hsl(120, 100%, 40%);">+tst suiteC: DBG: {combining='config'}</span><br><span style="color: hsl(120, 100%, 40%);">+tst {combining_scenarios='config'}: DBG: {definition_conf={}}  [suiteC↪{combining_scenarios='config'}]</span><br><span style="color: hsl(120, 100%, 40%);">+tst suiteD: DBG: {combining='config'}</span><br><span style="color: hsl(120, 100%, 40%);">+tst {combining_scenarios='config'}: DBG: {definition_conf={}}  [suiteD↪{combining_scenarios='config'}]</span><br><span style="color: hsl(120, 100%, 40%);">+<testsuites tests="10" errors="2" failures="1" time="102" name="trial"></span><br><span style="color: hsl(120, 100%, 40%);">+  <testsuite name="suiteA" hostname="localhost" tests="2" errors="0" failures="0" skipped="0" disabled="0" id="0"></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteA-0" time="30" classname="suiteA"></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteA-1" time="10" classname="suiteA"></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>yay this is a test-applied stdout</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <properties></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:foobar/potato" value="1234" /></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:orange" value="abcd" /></span><br><span style="color: hsl(120, 100%, 40%);">+    </properties></span><br><span style="color: hsl(120, 100%, 40%);">+  </testsuite></span><br><span style="color: hsl(120, 100%, 40%);">+  <testsuite name="suiteB" hostname="localhost" tests="3" errors="2" failures="0" skipped="0" disabled="0" id="1"></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteB-0" time="10" classname="suiteB"></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteB-1" time="0" classname="suiteB"></span><br><span style="color: hsl(120, 100%, 40%);">+      <error>could not run</error></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteB-2" time="0" classname="suiteB"></span><br><span style="color: hsl(120, 100%, 40%);">+      <error>could not run</error></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <properties></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:foobar/potato" value="1234" /></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:orange" value="abcd" /></span><br><span style="color: hsl(120, 100%, 40%);">+    </properties></span><br><span style="color: hsl(120, 100%, 40%);">+  </testsuite></span><br><span style="color: hsl(120, 100%, 40%);">+  <testsuite name="suiteC" hostname="localhost" tests="3" errors="0" failures="0" skipped="2" disabled="2" id="2"></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteC-0" time="0" classname="suiteC"></span><br><span style="color: hsl(120, 100%, 40%);">+      <skipped /></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteC-1" time="10" classname="suiteC"></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteC-2" time="0" classname="suiteC"></span><br><span style="color: hsl(120, 100%, 40%);">+      <skipped /></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <properties></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:foobar/potato" value="1234" /></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:orange" value="abcd" /></span><br><span style="color: hsl(120, 100%, 40%);">+    </properties></span><br><span style="color: hsl(120, 100%, 40%);">+  </testsuite></span><br><span style="color: hsl(120, 100%, 40%);">+  <testsuite name="suiteD" hostname="localhost" tests="2" errors="0" failures="1" skipped="0" disabled="0" id="3"></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteD-0" time="12" classname="suiteD"></span><br><span style="color: hsl(120, 100%, 40%);">+      <failure type="fake_fail_type">fake_fail_message</failure></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-err>system stderr fake content</system-err></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <testcase name="suiteD-1" time="10" classname="suiteD"></span><br><span style="color: hsl(120, 100%, 40%);">+      <system-out>test log file not available</system-out></span><br><span style="color: hsl(120, 100%, 40%);">+    </testcase></span><br><span style="color: hsl(120, 100%, 40%);">+    <properties></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:foobar/potato" value="1234" /></span><br><span style="color: hsl(120, 100%, 40%);">+      <property name="ref:orange" value="abcd" /></span><br><span style="color: hsl(120, 100%, 40%);">+    </properties></span><br><span style="color: hsl(120, 100%, 40%);">+  </testsuite></span><br><span style="color: hsl(120, 100%, 40%);">+</testsuites></span><br><span>diff --git a/selftest/report_test/report_test.py b/selftest/report_test/report_test.py</span><br><span>new file mode 100755</span><br><span>index 0000000..c19e78c</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/report_test.py</span><br><span>@@ -0,0 +1,119 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/usr/bin/env python3</span><br><span style="color: hsl(120, 100%, 40%);">+import _prep</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import report</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import log</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import util</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import test</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import suite</span><br><span style="color: hsl(120, 100%, 40%);">+from osmo_gsm_tester.core import config</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+import os</span><br><span style="color: hsl(120, 100%, 40%);">+import sys</span><br><span style="color: hsl(120, 100%, 40%);">+import shutil</span><br><span style="color: hsl(120, 100%, 40%);">+import re</span><br><span style="color: hsl(120, 100%, 40%);">+import xml.etree.ElementTree as etree</span><br><span style="color: hsl(120, 100%, 40%);">+import xml.etree.ElementTree as et</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+class FakeTrial(log.Origin):</span><br><span style="color: hsl(120, 100%, 40%);">+    def __init__(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        super().__init__(log.C_TST, 'trial')</span><br><span style="color: hsl(120, 100%, 40%);">+        self.dir = util.Dir(example_trial_dir)</span><br><span style="color: hsl(120, 100%, 40%);">+        self._run_dir = None</span><br><span style="color: hsl(120, 100%, 40%);">+        self.suites = []</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def get_all_inst_hash_info(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        return { 'foobar/potato': '1234', 'orange': 'abcd' }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    def get_run_dir(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        if self._run_dir is not None:</span><br><span style="color: hsl(120, 100%, 40%);">+            return self._run_dir</span><br><span style="color: hsl(120, 100%, 40%);">+        self._run_dir = util.Dir(self.dir.new_child('test_run'))</span><br><span style="color: hsl(120, 100%, 40%);">+        self._run_dir.mkdir()</span><br><span style="color: hsl(120, 100%, 40%);">+        return self._run_dir</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+class FakeSuiteDefinition(log.Origin):</span><br><span style="color: hsl(120, 100%, 40%);">+        def __init__(self, name, num_tests):</span><br><span style="color: hsl(120, 100%, 40%);">+            super().__init__(log.C_TST, name)</span><br><span style="color: hsl(120, 100%, 40%);">+            self.test_basenames = [name + '-' + str(tid) for tid in range(num_tests) ]</span><br><span style="color: hsl(120, 100%, 40%);">+            self.conf = {}</span><br><span style="color: hsl(120, 100%, 40%);">+            self.suite_dir = util.Dir(example_trial_dir).new_child('suitedef' + name)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def fake_run_test(test_obj, status, duration, sysout=None):</span><br><span style="color: hsl(120, 100%, 40%);">+    test_obj.status = status</span><br><span style="color: hsl(120, 100%, 40%);">+    test_obj.duration = duration</span><br><span style="color: hsl(120, 100%, 40%);">+    if sysout is not None:</span><br><span style="color: hsl(120, 100%, 40%);">+        test_obj.set_report_stdout(sysout)</span><br><span style="color: hsl(120, 100%, 40%);">+    if status == test.Test.FAIL:</span><br><span style="color: hsl(120, 100%, 40%);">+        test_obj.fail_type = 'fake_fail_type'</span><br><span style="color: hsl(120, 100%, 40%);">+        test_obj.fail_message = 'fake_fail_message'</span><br><span style="color: hsl(120, 100%, 40%);">+        test_obj.fail_tb = 'system stderr fake content'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def fake_run_suite(suite_obj, duration):</span><br><span style="color: hsl(120, 100%, 40%);">+    suite_obj.duration = duration</span><br><span style="color: hsl(120, 100%, 40%);">+    suite_obj.determine_status()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+config.override_conf = os.path.join(os.path.dirname(sys.argv[0]), 'main.conf')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+example_trial_dir = os.path.join('test_trial_tmp')</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+trial = FakeTrial()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Suite passes with 2 tests passing</span><br><span style="color: hsl(120, 100%, 40%);">+s_def = FakeSuiteDefinition('suiteA', 2)</span><br><span style="color: hsl(120, 100%, 40%);">+s = suite.SuiteRun(trial, s_def.name(), s_def)</span><br><span style="color: hsl(120, 100%, 40%);">+trial.suites.append(s)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[0], test.Test.PASS, 30)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[1], test.Test.PASS, 10, 'yay this is a test-applied stdout')</span><br><span style="color: hsl(120, 100%, 40%);">+#fake_run_test(suiteA.tests[0], test.Test.UNKNOWN, 20)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_suite(s, 50)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Suite passes first test but next ones are not ececuted</span><br><span style="color: hsl(120, 100%, 40%);">+s_def = FakeSuiteDefinition('suiteB', 3)</span><br><span style="color: hsl(120, 100%, 40%);">+s = suite.SuiteRun(trial, s_def.name(), s_def)</span><br><span style="color: hsl(120, 100%, 40%);">+trial.suites.append(s)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[0], test.Test.PASS, 10)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_suite(s, 20)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Suite passes one test selected, others are skipped</span><br><span style="color: hsl(120, 100%, 40%);">+s_def = FakeSuiteDefinition('suiteC', 3)</span><br><span style="color: hsl(120, 100%, 40%);">+s = suite.SuiteRun(trial, s_def.name(), s_def)</span><br><span style="color: hsl(120, 100%, 40%);">+trial.suites.append(s)</span><br><span style="color: hsl(120, 100%, 40%);">+s.tests[0].set_skip()</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[1], test.Test.PASS, 10)</span><br><span style="color: hsl(120, 100%, 40%);">+s.tests[2].set_skip()</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_suite(s, 12)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Suite fails due to one of its tests failing</span><br><span style="color: hsl(120, 100%, 40%);">+s_def = FakeSuiteDefinition('suiteD', 2)</span><br><span style="color: hsl(120, 100%, 40%);">+s = suite.SuiteRun(trial, s_def.name(), s_def)</span><br><span style="color: hsl(120, 100%, 40%);">+trial.suites.append(s)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[0], test.Test.FAIL, 12)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_test(s.tests[1], test.Test.PASS, 10)</span><br><span style="color: hsl(120, 100%, 40%);">+fake_run_suite(s, 20)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+def indent(elem, level=0):</span><br><span style="color: hsl(120, 100%, 40%);">+    i = "\n" + level*"  "</span><br><span style="color: hsl(120, 100%, 40%);">+    if len(elem):</span><br><span style="color: hsl(120, 100%, 40%);">+        if not elem.text or not elem.text.strip():</span><br><span style="color: hsl(120, 100%, 40%);">+            elem.text = i + "  "</span><br><span style="color: hsl(120, 100%, 40%);">+        if not elem.tail or not elem.tail.strip():</span><br><span style="color: hsl(120, 100%, 40%);">+            elem.tail = i</span><br><span style="color: hsl(120, 100%, 40%);">+        for elem in elem:</span><br><span style="color: hsl(120, 100%, 40%);">+            indent(elem, level+1)</span><br><span style="color: hsl(120, 100%, 40%);">+        if not elem.tail or not elem.tail.strip():</span><br><span style="color: hsl(120, 100%, 40%);">+            elem.tail = i</span><br><span style="color: hsl(120, 100%, 40%);">+    else:</span><br><span style="color: hsl(120, 100%, 40%);">+        if level and (not elem.tail or not elem.tail.strip()):</span><br><span style="color: hsl(120, 100%, 40%);">+            elem.tail = i</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+element = report.trial_to_junit(trial)</span><br><span style="color: hsl(120, 100%, 40%);">+indent(element)</span><br><span style="color: hsl(120, 100%, 40%);">+et.dump(element)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#deleting generated tmp trial dir:</span><br><span style="color: hsl(120, 100%, 40%);">+shutil.rmtree(example_trial_dir, ignore_errors=True)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# vim: expandtab tabstop=4 shiftwidth=4</span><br><span>diff --git a/selftest/report_test/resources.conf b/selftest/report_test/resources.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e69de29</span><br><span>--- /dev/null</span><br><span>+++ b/selftest/report_test/resources.conf</span><br><span>diff --git a/src/osmo_gsm_tester/core/suite.py b/src/osmo_gsm_tester/core/suite.py</span><br><span>index 938471c..a1d068e 100644</span><br><span>--- a/src/osmo_gsm_tester/core/suite.py</span><br><span>+++ b/src/osmo_gsm_tester/core/suite.py</span><br><span>@@ -189,18 +189,21 @@</span><br><span>             util.import_path_remove(suite_libdir)</span><br><span>             self.duration = time.time() - self.start_timestamp</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-            passed, skipped, failed, errors = self.count_test_results()</span><br><span style="color: hsl(0, 100%, 40%);">-            # if no tests ran, count it as failure</span><br><span style="color: hsl(0, 100%, 40%);">-            if passed and not failed and not errors:</span><br><span style="color: hsl(0, 100%, 40%);">-                self.status = SuiteRun.PASS</span><br><span style="color: hsl(0, 100%, 40%);">-            else:</span><br><span style="color: hsl(0, 100%, 40%);">-                self.status = SuiteRun.FAIL</span><br><span style="color: hsl(120, 100%, 40%);">+            self.determine_status()</span><br><span> </span><br><span>             log.large_separator(self._trial.name(), self.name(), self.status, sublevel=2, space_above=False)</span><br><span> </span><br><span>     def passed(self):</span><br><span>         return self.status == SuiteRun.PASS</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+    def determine_status(self):</span><br><span style="color: hsl(120, 100%, 40%);">+        passed, skipped, failed, errors = self.count_test_results()</span><br><span style="color: hsl(120, 100%, 40%);">+        # if no tests ran, count it as failure</span><br><span style="color: hsl(120, 100%, 40%);">+        if passed and not failed and not errors:</span><br><span style="color: hsl(120, 100%, 40%);">+            self.status = SuiteRun.PASS</span><br><span style="color: hsl(120, 100%, 40%);">+        else:</span><br><span style="color: hsl(120, 100%, 40%);">+            self.status = SuiteRun.FAIL</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     def count_test_results(self):</span><br><span>         passed = 0</span><br><span>         skipped = 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18825">change 18825</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18825"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I8cad02abe776cc00b513113dbaf3c948ea7956cd </div>
<div style="display:none"> Gerrit-Change-Number: 18825 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>