Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,21 @@ def uuid_list():
def webhook_event():
with open("tests/fixtures/webhook_event.json") as f:
return json.load(f)


@pytest.fixture
def failure_job():
with open("tests/fixtures/failedJob/job.json") as f:
return json.load(f)


@pytest.fixture
def failure_runs():
with open("tests/fixtures/failedJob/runs.json") as f:
return json.load(f)


@pytest.fixture
def failure_workflow():
with open("tests/fixtures/failedJob/workflow.json") as f:
return json.load(f)
106 changes: 106 additions & 0 deletions tests/fixtures/failedJob/job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"check_run_url": "https://api.github.com/repos/getsentry/ken-test-repo/check-runs/48858869248",
"completed_at": "2025-08-25T22:04:10Z",
"conclusion": "failure",
"created_at": "2025-08-25T22:03:57Z",
"head_branch": "initial_branch",
"head_sha": "ff29d0c21125f2743a09308fe086002d10667728",
"html_url": "https://github.com/getsentry/ken-test-repo/actions/runs/17217309463/job/48858869248",
"id": 48858869248,
"labels": ["ubuntu-latest"],
"name": "test",
"node_id": "CR_kwDOPkC4Ds8AAAALYDcuAA",
"run_attempt": 3,
"run_id": 17217309463,
"run_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463",
"runner_group_id": 0,
"runner_group_name": "GitHub Actions",
"runner_id": 1003040048,
"runner_name": "GitHub Actions 1003040048",
"started_at": "2025-08-25T22:04:00Z",
"status": "completed",
"steps": [
{
"completed_at": "2025-08-25T22:04:02Z",
"conclusion": "success",
"name": "Set up job",
"number": 1,
"started_at": "2025-08-25T22:04:01Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:03Z",
"conclusion": "success",
"name": "Checkout code",
"number": 2,
"started_at": "2025-08-25T22:04:02Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:03Z",
"conclusion": "success",
"name": "Set up Python",
"number": 3,
"started_at": "2025-08-25T22:04:03Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:07Z",
"conclusion": "success",
"name": "Install dependencies",
"number": 4,
"started_at": "2025-08-25T22:04:03Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:07Z",
"conclusion": "failure",
"name": "Run calculate tests",
"number": 5,
"started_at": "2025-08-25T22:04:07Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:07Z",
"conclusion": "skipped",
"name": "Run copywriting tests",
"number": 6,
"started_at": "2025-08-25T22:04:07Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:07Z",
"conclusion": "skipped",
"name": "Run all tests",
"number": 7,
"started_at": "2025-08-25T22:04:07Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:07Z",
"conclusion": "skipped",
"name": "Post Set up Python",
"number": 13,
"started_at": "2025-08-25T22:04:07Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:08Z",
"conclusion": "success",
"name": "Post Checkout code",
"number": 14,
"started_at": "2025-08-25T22:04:07Z",
"status": "completed"
},
{
"completed_at": "2025-08-25T22:04:08Z",
"conclusion": "success",
"name": "Complete job",
"number": 15,
"started_at": "2025-08-25T22:04:08Z",
"status": "completed"
}
],
"url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/jobs/48858869248",
"workflow_name": "Run Tests"
}
248 changes: 248 additions & 0 deletions tests/fixtures/failedJob/runs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"id": 17217309463,
"name": "Run Tests",
"node_id": "WFR_kwLOPkC4Ds8AAAAEAjtLFw",
"head_branch": "initial_branch",
"head_sha": "ff29d0c21125f2743a09308fe086002d10667728",
"path": ".github/workflows/test.yml",
"display_title": "updated to include a github token",
"run_number": 5,
"event": "push",
"status": "completed",
"conclusion": "failure",
"workflow_id": 183940573,
"check_suite_id": 44161335073,
"check_suite_node_id": "CS_kwDOPkC4Ds8AAAAKSDh_IQ",
"url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463",
"html_url": "https://github.com/getsentry/ken-test-repo/actions/runs/17217309463",
"pull_requests": [
{
"url": "https://api.github.com/repos/getsentry/ken-test-repo/pulls/1",
"id": 2772527459,
"number": 1,
"head": {
"ref": "initial_branch",
"sha": "ff29d0c21125f2743a09308fe086002d10667728",
"repo": {
"id": 1044428814,
"url": "https://api.github.com/repos/getsentry/ken-test-repo",
"name": "ken-test-repo"
}
},
"base": {
"ref": "main",
"sha": "49cec81145fb01f98ee21312d6977f184fc24b8a",
"repo": {
"id": 1044428814,
"url": "https://api.github.com/repos/getsentry/ken-test-repo",
"name": "ken-test-repo"
}
}
}
],
"created_at": "2025-08-25T18:26:38Z",
"updated_at": "2025-08-25T22:04:10Z",
"actor": {
"login": "kenzoengineer",
"id": 47985312,
"node_id": "MDQ6VXNlcjQ3OTg1MzEy",
"avatar_url": "https://avatars.githubusercontent.com/u/47985312?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kenzoengineer",
"html_url": "https://github.com/kenzoengineer",
"followers_url": "https://api.github.com/users/kenzoengineer/followers",
"following_url": "https://api.github.com/users/kenzoengineer/following{/other_user}",
"gists_url": "https://api.github.com/users/kenzoengineer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kenzoengineer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kenzoengineer/subscriptions",
"organizations_url": "https://api.github.com/users/kenzoengineer/orgs",
"repos_url": "https://api.github.com/users/kenzoengineer/repos",
"events_url": "https://api.github.com/users/kenzoengineer/events{/privacy}",
"received_events_url": "https://api.github.com/users/kenzoengineer/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
"run_attempt": 3,
"referenced_workflows": [],
"run_started_at": "2025-08-25T22:03:55Z",
"triggering_actor": {
"login": "kenzoengineer",
"id": 47985312,
"node_id": "MDQ6VXNlcjQ3OTg1MzEy",
"avatar_url": "https://avatars.githubusercontent.com/u/47985312?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/kenzoengineer",
"html_url": "https://github.com/kenzoengineer",
"followers_url": "https://api.github.com/users/kenzoengineer/followers",
"following_url": "https://api.github.com/users/kenzoengineer/following{/other_user}",
"gists_url": "https://api.github.com/users/kenzoengineer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/kenzoengineer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kenzoengineer/subscriptions",
"organizations_url": "https://api.github.com/users/kenzoengineer/orgs",
"repos_url": "https://api.github.com/users/kenzoengineer/repos",
"events_url": "https://api.github.com/users/kenzoengineer/events{/privacy}",
"received_events_url": "https://api.github.com/users/kenzoengineer/received_events",
"type": "User",
"user_view_type": "public",
"site_admin": false
},
"jobs_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/jobs",
"logs_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/logs",
"check_suite_url": "https://api.github.com/repos/getsentry/ken-test-repo/check-suites/44161335073",
"artifacts_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/artifacts",
"cancel_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/cancel",
"rerun_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/rerun",
"previous_attempt_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/runs/17217309463/attempts/2",
"workflow_url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/workflows/183940573",
"head_commit": {
"id": "ff29d0c21125f2743a09308fe086002d10667728",
"tree_id": "f0d3d350d50042489ae21fc2e67c311199bf57c0",
"message": "updated to include a github token",
"timestamp": "2025-08-25T18:26:33Z",
"author": {
"name": "kenzoengineer",
"email": "kenzoengineer@gmail.com"
},
"committer": {
"name": "kenzoengineer",
"email": "kenzoengineer@gmail.com"
}
},
"repository": {
"id": 1044428814,
"node_id": "R_kgDOPkC4Dg",
"name": "ken-test-repo",
"full_name": "getsentry/ken-test-repo",
"private": true,
"owner": {
"login": "getsentry",
"id": 1396951,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1396951?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/getsentry",
"html_url": "https://github.com/getsentry",
"followers_url": "https://api.github.com/users/getsentry/followers",
"following_url": "https://api.github.com/users/getsentry/following{/other_user}",
"gists_url": "https://api.github.com/users/getsentry/gists{/gist_id}",
"starred_url": "https://api.github.com/users/getsentry/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/getsentry/subscriptions",
"organizations_url": "https://api.github.com/users/getsentry/orgs",
"repos_url": "https://api.github.com/users/getsentry/repos",
"events_url": "https://api.github.com/users/getsentry/events{/privacy}",
"received_events_url": "https://api.github.com/users/getsentry/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"html_url": "https://github.com/getsentry/ken-test-repo",
"description": "amazing ken test repo",
"fork": false,
"url": "https://api.github.com/repos/getsentry/ken-test-repo",
"forks_url": "https://api.github.com/repos/getsentry/ken-test-repo/forks",
"keys_url": "https://api.github.com/repos/getsentry/ken-test-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/getsentry/ken-test-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/getsentry/ken-test-repo/teams",
"hooks_url": "https://api.github.com/repos/getsentry/ken-test-repo/hooks",
"issue_events_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/getsentry/ken-test-repo/events",
"assignees_url": "https://api.github.com/repos/getsentry/ken-test-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/getsentry/ken-test-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/getsentry/ken-test-repo/tags",
"blobs_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/getsentry/ken-test-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/getsentry/ken-test-repo/languages",
"stargazers_url": "https://api.github.com/repos/getsentry/ken-test-repo/stargazers",
"contributors_url": "https://api.github.com/repos/getsentry/ken-test-repo/contributors",
"subscribers_url": "https://api.github.com/repos/getsentry/ken-test-repo/subscribers",
"subscription_url": "https://api.github.com/repos/getsentry/ken-test-repo/subscription",
"commits_url": "https://api.github.com/repos/getsentry/ken-test-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/getsentry/ken-test-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/getsentry/ken-test-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/getsentry/ken-test-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/getsentry/ken-test-repo/merges",
"archive_url": "https://api.github.com/repos/getsentry/ken-test-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/getsentry/ken-test-repo/downloads",
"issues_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/getsentry/ken-test-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/getsentry/ken-test-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/getsentry/ken-test-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/getsentry/ken-test-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/getsentry/ken-test-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/getsentry/ken-test-repo/deployments"
},
"head_repository": {
"id": 1044428814,
"node_id": "R_kgDOPkC4Dg",
"name": "ken-test-repo",
"full_name": "getsentry/ken-test-repo",
"private": true,
"owner": {
"login": "getsentry",
"id": 1396951,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjEzOTY5NTE=",
"avatar_url": "https://avatars.githubusercontent.com/u/1396951?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/getsentry",
"html_url": "https://github.com/getsentry",
"followers_url": "https://api.github.com/users/getsentry/followers",
"following_url": "https://api.github.com/users/getsentry/following{/other_user}",
"gists_url": "https://api.github.com/users/getsentry/gists{/gist_id}",
"starred_url": "https://api.github.com/users/getsentry/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/getsentry/subscriptions",
"organizations_url": "https://api.github.com/users/getsentry/orgs",
"repos_url": "https://api.github.com/users/getsentry/repos",
"events_url": "https://api.github.com/users/getsentry/events{/privacy}",
"received_events_url": "https://api.github.com/users/getsentry/received_events",
"type": "Organization",
"user_view_type": "public",
"site_admin": false
},
"html_url": "https://github.com/getsentry/ken-test-repo",
"description": "amazing ken test repo",
"fork": false,
"url": "https://api.github.com/repos/getsentry/ken-test-repo",
"forks_url": "https://api.github.com/repos/getsentry/ken-test-repo/forks",
"keys_url": "https://api.github.com/repos/getsentry/ken-test-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/getsentry/ken-test-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/getsentry/ken-test-repo/teams",
"hooks_url": "https://api.github.com/repos/getsentry/ken-test-repo/hooks",
"issue_events_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/getsentry/ken-test-repo/events",
"assignees_url": "https://api.github.com/repos/getsentry/ken-test-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/getsentry/ken-test-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/getsentry/ken-test-repo/tags",
"blobs_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/getsentry/ken-test-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/getsentry/ken-test-repo/languages",
"stargazers_url": "https://api.github.com/repos/getsentry/ken-test-repo/stargazers",
"contributors_url": "https://api.github.com/repos/getsentry/ken-test-repo/contributors",
"subscribers_url": "https://api.github.com/repos/getsentry/ken-test-repo/subscribers",
"subscription_url": "https://api.github.com/repos/getsentry/ken-test-repo/subscription",
"commits_url": "https://api.github.com/repos/getsentry/ken-test-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/getsentry/ken-test-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/getsentry/ken-test-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/getsentry/ken-test-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/getsentry/ken-test-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/getsentry/ken-test-repo/merges",
"archive_url": "https://api.github.com/repos/getsentry/ken-test-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/getsentry/ken-test-repo/downloads",
"issues_url": "https://api.github.com/repos/getsentry/ken-test-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/getsentry/ken-test-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/getsentry/ken-test-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/getsentry/ken-test-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/getsentry/ken-test-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/getsentry/ken-test-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/getsentry/ken-test-repo/deployments"
}
}
12 changes: 12 additions & 0 deletions tests/fixtures/failedJob/workflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": 48858869248,
"node_id": "CR_kwDOPkC4Ds8AAAALYDcuAA",
"name": "test",
"path": ".github/workflows/test.yml",
"state": "active",
"created_at": "2025-08-25T22:03:57Z",
"updated_at": "2025-08-25T22:03:57Z",
"url": "https://api.github.com/repos/getsentry/ken-test-repo/actions/workflows/48858869248",
"html_url": "https://github.com/getsentry/ken-test-repo/actions/workflows/test.yml",
"badge_url": "https://github.com/getsentry/ken-test-repo/workflows/test/badge.svg"
}
Loading