MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / getResultsForRun

Function getResultsForRun

pythonFiles/aggregateTestResults.py:63–102  ·  view source on GitHub ↗
(run)

Source from the content-addressed store, hash-verified

61
62
63def getResultsForRun(run):
64 url = run["artifacts_url"]
65 print(f"Getting artifacts from {url}")
66 artifactsResponse = requests.get(
67 url, headers={"Accept": "application/vnd.github+json"}
68 )
69
70 if artifactsResponse.status_code != 200:
71 print(f"Error {artifactsResponse.status_code} getting artifacts")
72 return []
73
74 artifacts = artifactsResponse.json()["artifacts"]
75
76 results = []
77 for artifact in artifacts:
78 if (
79 artifact["name"].startswith(
80 "TestResult-" # previous artifact name (pre ~2022-09-12)
81 )
82 or artifact["name"].startswith(
83 "TestResults-" # previous performance tests artifact name
84 )
85 or artifact["name"].startswith(
86 "TestLogs-" # consolidated artifact name, contains multiple files
87 )
88 ):
89 print(f" retrieving {artifact['name']}")
90 rawData = getArtifactData(artifact["id"])
91 testRunResults = getResultsJson(rawData)
92 results.append(
93 {
94 "scenario": artifact["name"],
95 "date": run["created_at"],
96 "runUrl": run["html_url"],
97 "data": testRunResults,
98 }
99 )
100 print(f" {len(testRunResults)} results read")
101
102 return results
103
104
105def flattenTestResultsToFile(runResults, filename):

Callers 1

Calls 5

getArtifactDataFunction · 0.85
getResultsJsonFunction · 0.85
jsonMethod · 0.80
getMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected