Skip to content

Commit

Permalink
Add comment by the bot how to launch BCI tests on the staging project
Browse files Browse the repository at this point in the history
  • Loading branch information
dcermak committed Jun 27, 2023
1 parent ec9cac7 commit 1b847fc
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/staging/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,18 @@ async def fetch_build_results(self) -> list[RepositoryBuildResult]:
(await self._run_cmd(self._osc_fetch_results_cmd())).stdout
)

@property
def staging_project_registry_base_url(self) -> str:
"""Returns the base url to the containers in the staging project on
OBS. This url is missing the repository name and the actual container
tag, but it can be used to plug the staging project directly into
BCI-tests.
"""
return "registry.opensuse.org/" + self.staging_project_name.lower().replace(
":", "/"
)

async def force_rebuild(self) -> str:
"""Deletes all binaries of the project on OBS and force rebuilds everything."""
await self._run_cmd(
Expand Down Expand Up @@ -1688,7 +1700,15 @@ async def _create_staging_proj():
elif action == "query_build_result":

async def print_build_res():
return render_as_markdown(await bot.fetch_build_results())
prefix = ""
# we don't support BCI tests for Tumbleweed yet…
if bot.os_version != OsVersion.TUMBLEWEED:
prefix = f"""You can run the BCI test suite against this PR via:
```ShellSession
$ OS_VERSION=15.{bot.os_version} TARGET=custom BASEURL={bot.staging_project_registry_base_url} tox -e $ENV -- -n auto
```
"""
return prefix + render_as_markdown(await bot.fetch_build_results())

coro = print_build_res()

Expand Down

0 comments on commit 1b847fc

Please sign in to comment.