Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add job and run id to test reports #18832

Merged
merged 1 commit into from
Nov 2, 2022
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
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