Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita committed Sep 29, 2023
1 parent 4fa5140 commit a83f598
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/cli/onefuzz/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,40 +647,42 @@ def test_template(

if report is not None:
try:
report = RegressionReport.parse_raw(report)
the_report = RegressionReport.parse_raw(report)
print("testing regression report")
except Exception:
report = Report.parse_raw(report)
the_report = Report.parse_raw(report)
print("testing normal report")

if task_id is not None:
task = self.onefuzz.tasks.get(task_id)
if report is None:
if the_report is None:
input_blob_ref = BlobRef(
account="dummy-storage-account",
container="test-notification-crashes",
name="fake-crash-sample",
)
report = self._create_report(
the_report = self._create_report(
task.job_id, task.task_id, "fake_target.exe", input_blob_ref
)
elif isinstance(report, RegressionReport):
report.crash_test_result.crash_report.task_id = task.task_id
report.crash_test_result.crash_report.job_id = task.job_id
elif isinstance(the_report, RegressionReport):
if the_report.crash_test_result.crash_report is None:
raise Exception("invalid regression report: no crash report")
the_report.crash_test_result.crash_report.task_id = task.task_id
the_report.crash_test_result.crash_report.job_id = task.job_id
else:
report.task_id = task.task_id
report.job_id = task.job_id
elif report is None:
the_report.task_id = task.task_id
the_report.job_id = task.job_id
elif the_report is None:
raise Exception("must specify either task_id or report")

report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"
the_report.report_url = "https://dummy-container.blob.core.windows.net/dummy-reports/dummy-report.json"

endpoint = Endpoint(self.onefuzz)
return endpoint._req_model(
"POST",
responses.NotificationTestResponse,
data=requests.NotificationTest(
report=report,
report=the_report,
notification=models.Notification(
container=Container("test-notification-reports"),
notification_id=uuid.uuid4(),
Expand Down

0 comments on commit a83f598

Please sign in to comment.