Skip to content

Commit

Permalink
Output testing-farm watch command and give extensively more time
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Aug 5, 2024
1 parent 020733f commit 48ca1b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion snapshot_manager/snapshot_manager/testing_farm_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def watch(self) -> tuple["TestingFarmWatchResult", str]:
cmd = f"testing-farm watch --no-wait --id {self.request_id}"
# We ignore the exit code because in case of a test error, 1 is the exit code
try:
_, stdout, stderr = util.run_cmd(cmd=cmd, timeout_secs=20)
logging.info(f"Watching for testing-farm request: {cmd}")
_, stdout, stderr = util.run_cmd(cmd=cmd, timeout_secs=40)
watch_result, artifacts_url = TestingFarmWatchResult.from_output(stdout)
if watch_result is None:
raise SystemError(
Expand Down Expand Up @@ -625,6 +626,13 @@ def from_output(cls, string: str) -> tuple["TestingFarmWatchResult", str]:
>>> s = base64.b64decode(s).decode()
>>> TestingFarmWatchResult.from_output(s)
(<TestingFarmWatchResult.REQUEST_RUNNING: 'request is running'>, 'https://artifacts.dev.testing-farm.io/97a7cc24-6926-4059-84ac-d0078297c319')
>>> s='''8J+UjiBhcGkgaHR0cHM6Ly9hcGkuZGV2LnRlc3RpbmctZmFybS5pby92MC4xL3JlcXVlc3RzLzg2
... MGExZjdlLTA2NmMtNGU0Mi1iYWRkLThlNmRjYTkwYzE0Ygrwn5qiIGFydGlmYWN0cyBodHRwczov
... L2FydGlmYWN0cy5vc2NpLnJlZGhhdC5jb20vdGVzdGluZy1mYXJtLzg2MGExZjdlLTA2NmMtNGU0
... Mi1iYWRkLThlNmRjYTkwYzE0YgrinIUgdGVzdHMgcGFzc2VkCg=='''
>>> s = base64.b64decode(s).decode()
>>> TestingFarmWatchResult.from_output(s)
(<TestingFarmWatchResult.TESTS_PASSED: 'tests passed'>, 'https://artifacts.osci.redhat.com/testing-farm/860a1f7e-066c-4e42-badd-8e6dca90c14b')
"""
string = clean_testing_farm_output(string)
for watch_result in TestingFarmWatchResult.all_watch_results():
Expand Down

0 comments on commit 48ca1b1

Please sign in to comment.