From a3202de70aec30d9435dde57fcddeaa7712cdae1 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:03:56 +0000 Subject: [PATCH] Add missing repo to WorkflowRun schema --- bert_e/git_host/github/schema.py | 1 + bert_e/tests/unit/test_github_build_status.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bert_e/git_host/github/schema.py b/bert_e/git_host/github/schema.py index 9f4d18fb..60370202 100644 --- a/bert_e/git_host/github/schema.py +++ b/bert_e/git_host/github/schema.py @@ -141,6 +141,7 @@ class WorkflowRun(GitHubSchema): check_suite_id = fields.Integer() html_url = fields.Str() event = fields.Str() + repository = fields.Nested(Repo) workflow_id = fields.Integer() diff --git a/bert_e/tests/unit/test_github_build_status.py b/bert_e/tests/unit/test_github_build_status.py index 58937359..c929f35b 100644 --- a/bert_e/tests/unit/test_github_build_status.py +++ b/bert_e/tests/unit/test_github_build_status.py @@ -70,15 +70,23 @@ def workflow_run_json(): def test_aggregated_workflow_run_api_client(client): """Run the workflow run client with the GitHub mock server.""" + head_sha = 'acb5820ced9479c074f688cc328bf03f341a511d' + owner = 'octocat' + repo = 'Hello-World' workflow_runs = AggregatedWorkflowRuns.get( client=client, - owner='octo-org', - repo='Hello-World', + owner=owner, + repo=repo, params={ - 'head_sha': 'd6fde92930d4715a2b49857d24b940956b26d2d3' + 'head_sha': head_sha } ) assert workflow_runs.state == 'INPROGRESS' + assert workflow_runs.full_repo == f'{owner}/{repo}' + assert workflow_runs.commit == head_sha + assert workflow_runs.owner == owner + assert workflow_runs.repo == repo + assert workflow_runs.branch == 'master' def test_aggregated_workflow_run(client, workflow_run_json):