|
32 | 32 | from obs_package_update.util import CommandError |
33 | 33 | from obs_package_update.util import CommandResult |
34 | 34 | from obs_package_update.util import retry_async_run_cmd |
35 | | -from obs_package_update.util import run_cmd |
36 | 35 | from obs_package_update.util import RunCommand |
37 | 36 | from staging.build_result import Arch |
38 | 37 | from staging.build_result import PackageBuildResult |
@@ -1441,6 +1440,7 @@ def main() -> None: |
1441 | 1440 | import logging |
1442 | 1441 | import os.path |
1443 | 1442 | import sys |
| 1443 | + import stat |
1444 | 1444 | from typing import Any |
1445 | 1445 |
|
1446 | 1446 | from bci_build.package import ALL_OS_VERSIONS |
@@ -1798,24 +1798,28 @@ async def _pkgs_as_str() -> str: |
1798 | 1798 | async def _run_tests() -> str: |
1799 | 1799 | tox_env = os.getenv("TOX_ENV") |
1800 | 1800 | bci_tests_branch = os.getenv("BCI_TESTS_BRANCH") |
1801 | | - await run_cmd( |
1802 | | - f"git clone https://github.com/SUSE/BCI-tests", logger=LOGGER |
1803 | | - ) |
1804 | | - runner = RunCommand( |
1805 | | - cwd=os.path.join(os.getcwd(), "BCI-tests"), logger=LOGGER |
1806 | | - ) |
| 1801 | + |
| 1802 | + script = fr"""#!/bin/bash |
| 1803 | +set -euxo pipefail |
| 1804 | +
|
| 1805 | +git clone https://github.com/SUSE/BCI-tests |
| 1806 | +pushd BCI-tests |
| 1807 | +export OS_VERSION="15.{bot.os_version}" |
| 1808 | +export TARGET="custom" |
| 1809 | +export BASEURL="{bot.staging_project_registry_base_url}" |
| 1810 | +export TOX_SKIP_ENV='py(\d+)-unit' |
| 1811 | +""" |
1807 | 1812 | if bci_tests_branch: |
1808 | | - await runner(f"git checkout {bci_tests_branch}") |
1809 | | - |
1810 | | - test_res = await runner( |
1811 | | - f"tox {'-e ' + tox_env if tox_env else ''} -- -n auto", |
1812 | | - env={ |
1813 | | - "OS_VERSION": f"15.{bot.os_version}", |
1814 | | - "TARGET": "custom", |
1815 | | - "BASEURL": bot.staging_project_registry_base_url, |
1816 | | - }, |
1817 | | - ) |
1818 | | - return test_res.stdout |
| 1813 | + script += f"""git checkout {bci_tests_branch} |
| 1814 | +""" |
| 1815 | + |
| 1816 | + script += f"tox{' -e ' + tox_env if tox_env else ''} -- -n auto" |
| 1817 | + |
| 1818 | + with open("run_bci_tests.sh", "w") as bci_tests_sh: |
| 1819 | + bci_tests_sh.write(script) |
| 1820 | + |
| 1821 | + os.chmod("run_bci_tests.sh", 0o755) |
| 1822 | + return "" |
1819 | 1823 |
|
1820 | 1824 | coro = _run_tests() |
1821 | 1825 |
|
|
0 commit comments