|
31 | 31 | from obs_package_update.util import CommandError |
32 | 32 | from obs_package_update.util import CommandResult |
33 | 33 | from obs_package_update.util import retry_async_run_cmd |
34 | | -from obs_package_update.util import run_cmd |
35 | 34 | from obs_package_update.util import RunCommand |
36 | 35 | from staging.build_result import Arch |
37 | 36 | from staging.build_result import PackageBuildResult |
@@ -1504,6 +1503,7 @@ def main() -> None: |
1504 | 1503 | import logging |
1505 | 1504 | import os.path |
1506 | 1505 | import sys |
| 1506 | + import stat |
1507 | 1507 | from typing import Any |
1508 | 1508 |
|
1509 | 1509 | from bci_build.package import ALL_OS_VERSIONS |
@@ -1863,24 +1863,28 @@ async def _pkgs_as_str() -> str: |
1863 | 1863 | async def _run_tests() -> str: |
1864 | 1864 | tox_env = os.getenv("TOX_ENV") |
1865 | 1865 | bci_tests_branch = os.getenv("BCI_TESTS_BRANCH") |
1866 | | - await run_cmd( |
1867 | | - f"git clone https://github.com/SUSE/BCI-tests", logger=LOGGER |
1868 | | - ) |
1869 | | - runner = RunCommand( |
1870 | | - cwd=os.path.join(os.getcwd(), "BCI-tests"), logger=LOGGER |
1871 | | - ) |
| 1866 | + |
| 1867 | + script = fr"""#!/bin/bash |
| 1868 | +set -euxo pipefail |
| 1869 | +
|
| 1870 | +git clone https://github.com/SUSE/BCI-tests |
| 1871 | +pushd BCI-tests |
| 1872 | +export OS_VERSION="15.{bot.os_version}" |
| 1873 | +export TARGET="custom" |
| 1874 | +export BASEURL="{bot.staging_project_registry_base_url}" |
| 1875 | +export TOX_SKIP_ENV='py(\d+)-unit' |
| 1876 | +""" |
1872 | 1877 | if bci_tests_branch: |
1873 | | - await runner(f"git checkout {bci_tests_branch}") |
1874 | | - |
1875 | | - test_res = await runner( |
1876 | | - f"tox {'-e ' + tox_env if tox_env else ''} -- -n auto", |
1877 | | - env={ |
1878 | | - "OS_VERSION": f"15.{bot.os_version}", |
1879 | | - "TARGET": "custom", |
1880 | | - "BASEURL": bot.staging_project_registry_base_url, |
1881 | | - }, |
1882 | | - ) |
1883 | | - return test_res.stdout |
| 1878 | + script += f"""git checkout {bci_tests_branch} |
| 1879 | +""" |
| 1880 | + |
| 1881 | + script += f"tox{' -e ' + tox_env if tox_env else ''} -- -n auto" |
| 1882 | + |
| 1883 | + with open("run_bci_tests.sh", "w") as bci_tests_sh: |
| 1884 | + bci_tests_sh.write(script) |
| 1885 | + |
| 1886 | + os.chmod("run_bci_tests.sh", 0o755) |
| 1887 | + return "" |
1884 | 1888 |
|
1885 | 1889 | coro = _run_tests() |
1886 | 1890 |
|
|
0 commit comments