Skip to content

Commit

Permalink
ci: add job and run id to test reports (#18832)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conor authored and nataly committed Nov 3, 2022
1 parent 52d3ec6 commit 5b4de1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ jobs:
- name: Prep Test Results For GCS
if: always()
run: |
python tools/bin/prep_test_results_for_gcs.py --json connectors_base_results.json
python tools/bin/prep_test_results_for_gcs.py --json connectors_base_results.json --jobid $GITHUB_JOB --runid $GITHUB_RUN_ID
- name: Upload Test Results to GCS
if: always()
Expand Down Expand Up @@ -582,7 +582,7 @@ jobs:
- name: Prep Test Results For GCS
if: always()
run: |
python tools/bin/prep_test_results_for_gcs.py --json platform_results.json
python tools/bin/prep_test_results_for_gcs.py --json platform_results.json --jobid $GITHUB_JOB --runid $GITHUB_RUN_ID
- name: Upload Test Results to GCS
if: always()
Expand Down Expand Up @@ -768,7 +768,7 @@ jobs:
- name: Prep Test Results For GCS
if: always()
run: |
python tools/bin/prep_test_results_for_gcs.py --json kube_results.json
python tools/bin/prep_test_results_for_gcs.py --json kube_results.json --jobid $GITHUB_JOB --runid $GITHUB_RUN_ID
- name: Upload Test Results to GCS
if: always()
Expand Down
4 changes: 4 additions & 0 deletions tools/bin/prep_test_results_for_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

# Add long and short argument
parser.add_argument("--json", "-j", help="Path to the result json output by https://github.com/EnricoMi/publish-unit-test-result-action")
parser.add_argument("--runid", "-r", help="Run id of the action") # this can be derived from checks api, but it's easier to derive it here
parser.add_argument("--jobid", "-c", help="Job id of the action") # this can be derived from checks api, but it's easier to derive it here

def main():
# Read arguments from the command line
Expand All @@ -40,6 +42,8 @@ def main():
"time": elem['states'][conclusion][i]['time'],
"state": conclusion,
"check_run_id": check_run_id,
"workflow_run_id": args.runid,
"job_id": args.jobid,
"repo": "airbytehq/airbyte"
}
out.append(output)
Expand Down

0 comments on commit 5b4de1f

Please sign in to comment.