Skip to content

Commit

Permalink
include all build and test runs that run against main (#11494)
Browse files Browse the repository at this point in the history
* include all events that run against main

* just use a query parameter for branch filtering

* use parameter map
  • Loading branch information
amunger authored Sep 30, 2022
1 parent 25352ce commit 5e6012b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pythonFiles/aggregateTestResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# %%
def getRuns(createdDate):
runsResponse = requests.get(
"https://api.github.com/repos/microsoft/vscode-jupyter/actions/runs",
params={"event": "push", "created": createdDate},
"https://api.github.com/repos/microsoft/vscode-jupyter/actions/workflows/build-test.yml/runs",
params={"created": createdDate, "branch": "main"},
headers={
"Accept": "application/vnd.github+json",
"Authorization": f"Bearer {authtoken}",
Expand All @@ -23,9 +23,12 @@ def getRuns(createdDate):
print(f"Error {runsResponse.status_code}")
raise Exception("Error getting runs")

print(f"Found {len(runsResponse.json()['workflow_runs'])} runs")
runs = runsResponse.json()["workflow_runs"]

return runsResponse.json()["workflow_runs"]
for run in runs:
print(f"Found run {run['id']} for event '{run['event']}'")

return runs


def getArtifactData(id):
Expand Down Expand Up @@ -157,8 +160,7 @@ def flattenTestResultsToFile(runResults, filename):
# %%
runResults = []
for run in runs:
if run["name"] == "Build and Test":
runResults.append(getResultsForRun(run))
runResults.append(getResultsForRun(run))

# %%
resultFile = f'AggTestResults-{collectionDate.strftime("%Y-%m-%d")}.json'
Expand Down

0 comments on commit 5e6012b

Please sign in to comment.