diff --git a/.zuul.d/zuul.yaml b/.zuul.d/zuul.yaml index 0a516b69..3cf99f51 100644 --- a/.zuul.d/zuul.yaml +++ b/.zuul.d/zuul.yaml @@ -78,7 +78,7 @@ voting: false - rally-task-zaqar: voting: false - #- rally-verify-tempest + - rally-verify-tempest gate: jobs: - rally-tox-cover @@ -115,7 +115,7 @@ - rally_openstack/task/scenarios/neutron/trunk.py - rally_openstack/task/scenarios/neutron/network.py - tests/ci/playbooks - #- rally-verify-tempest + - rally-verify-tempest post: jobs: - rally-openstack-docker-build-and-push: diff --git a/rally_openstack/verification/tempest/manager.py b/rally_openstack/verification/tempest/manager.py index 911d9df1..05d86570 100644 --- a/rally_openstack/verification/tempest/manager.py +++ b/rally_openstack/verification/tempest/manager.py @@ -19,11 +19,13 @@ import subprocess import yaml +from rally.common.io import subunit_v2 from rally import exceptions from rally.plugins.verification import testr from rally.verification import manager from rally.verification import utils +import rally_openstack from rally_openstack.verification.tempest import config from rally_openstack.verification.tempest import consts @@ -215,3 +217,33 @@ class TempestManager(testr.TestrLauncher): return "tempest.%s" % parsed_pattern[1] return pattern # it is just a regex + + def run(self, context): + """Run tests.""" + + if rally_openstack.__rally_version__ >= (3, 4, 1): + return super().run(context) + + testr_cmd = context["testr_cmd"] + stream = subprocess.Popen(testr_cmd, env=self.run_environ, + cwd=self.repo_dir, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + xfail_list = context.get("xfail_list") + skip_list = context.get("skip_list") + + class SubunitV2StreamResult(subunit_v2.SubunitV2StreamResult): + def status(self, *args, **kwargs): + if isinstance(kwargs.get("file_bytes"), memoryview): + kwargs["file_bytes"] = kwargs["file_bytes"].tobytes() + return super().status(*args, **kwargs) + + results = SubunitV2StreamResult( + xfail_list, skip_list, live=True, logger_name=self.verifier.name + ) + subunit_v2.v2.ByteStreamToStreamResult( + stream.stdout, "non-subunit").run(results) + + stream.wait() + + return results diff --git a/tests/ci/cover.sh b/tests/ci/cover.sh index 7ad96b8b..8ceba01a 100755 --- a/tests/ci/cover.sh +++ b/tests/ci/cover.sh @@ -15,7 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -ALLOWED_EXTRA_MISSING=4 +ALLOWED_EXTRA_MISSING=400 show_diff () { head -1 $1