Skip to content

Commit a0d2ff4

Browse files
committed
more test fixes
1 parent 66eac4a commit a0d2ff4

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/packit_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def do_refresh_git():
112112

113113
def run(self, packet_group, parameters):
114114
def do_run():
115-
branch = "main"
115+
# TODO: REVERT THIS!!!
116+
branch = "mrc-6454-add-delay-to-diagnostic" #"main"
116117
commit = self.__get_latest_commit_for_branch(branch)
117118
data = {
118119
"name": packet_group,

src/packit_client_exception.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ def __init__(self, response):
55
msg = "Unexpected response status from Packit API: " + \
66
f"{response.status_code}."
77
if "error" in json and "detail" in json["error"]:
8-
msg = f"{msg} Detail: {json["error"]["detail"]}"
8+
detail = json["error"]["detail"]
9+
msg = f"{msg} Detail: {detail}"
910
super().__init__(msg)

test/integration/test_worker.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from src.config import Config
88
from src.utils.running_reports_repository import RunningReportsRepository
9-
from src.orderlyweb_client_wrapper import OrderlyWebClientWrapper
9+
from src.packit_client import PackitClient
1010
from test.integration.yt_utils import YouTrackUtils
1111
from test.integration.file_utils import write_text_file
1212

@@ -68,12 +68,11 @@ def test_later_task_kills_earlier_task_report():
6868

6969
assert len(versions) == 2
7070

71-
# Check first report key's status with OrderlyWeb - should have been killed
71+
# Check first report key's status with Packit - should have been killed
7272
config = Config()
73-
wrapper = OrderlyWebClientWrapper(config)
74-
result = wrapper.execute(wrapper.ow.report_status, first_report_key)
75-
assert result.status == "interrupted"
76-
assert result.finished
73+
packit = PackitClient(config)
74+
result = packit.poll(first_report_key)
75+
assert result["status"] == "CANCELLED"
7776

7877
# Check redis key has been tidied up
7978
assert running_repo.get("testGroup", "testDisease", "diagnostic") is None

test/unit/test_run_reports.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from src.utils.run_reports import run_reports
22
from src.config import ReportConfig
3-
from orderlyweb_api import ReportStatusResult
43
from unittest.mock import patch, call, Mock
5-
from src.orderlyweb_client_wrapper import OrderlyWebClientWrapper
64

75
reports = [ReportConfig("r1", None, ["r1@example.com"], "Subj: r1",
86
"a.ssignee", ["Funders"]),

0 commit comments

Comments
 (0)