Skip to content

Commit

Permalink
Add missing repository to WorkflowRun schema (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet authored Oct 17, 2024
1 parent 45ccec7 commit 899ef72
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions bert_e/git_host/github/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
14 changes: 11 additions & 3 deletions bert_e/tests/unit/test_github_build_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 899ef72

Please sign in to comment.