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 Mar 14, 2023
1 parent 224e31c commit 80f4dba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scratch-build-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,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
12 changes: 12 additions & 0 deletions 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

0 comments on commit 80f4dba

Please sign in to comment.