diff --git a/pipelines/e2e/Jenkinsfile b/pipelines/e2e/Jenkinsfile index 084ec23df9..7d2dce8568 100644 --- a/pipelines/e2e/Jenkinsfile +++ b/pipelines/e2e/Jenkinsfile @@ -171,7 +171,7 @@ node { summary = robot outputPath: '.' if(JOB_BASE_NAME != "longhorn-e2e-test") { - sh "docker exec ${JOB_BASE_NAME}-${BUILD_NUMBER} pipelines/utilities/junit_to_qase.py junit.xml" + sh "docker exec ${JOB_BASE_NAME}-${BUILD_NUMBER} pipelines/utilities/junit_to_qase.py junit.xml ${BUILD_URL}" } } diff --git a/pipelines/utilities/junit_to_qase.py b/pipelines/utilities/junit_to_qase.py index 40deac947c..e1ee362d57 100755 --- a/pipelines/utilities/junit_to_qase.py +++ b/pipelines/utilities/junit_to_qase.py @@ -145,7 +145,7 @@ def get_test_cases_id_and_add_missing_test_cases(test_results): result["case_id"] = add_missing_case(result["case"], result["suite_id"]) -def create_test_run(job_name, test_results): +def create_test_run(job_name, test_results, build_url): test_cases_id = [] for result in test_results: @@ -153,7 +153,8 @@ def create_test_run(job_name, test_results): payload = { "cases": test_cases_id, - "title": job_name + "title": job_name, + "description": build_url } headers = { "accept": "application/json", @@ -230,6 +231,7 @@ def complete_test_run(test_run_id): raise Exception("Report filename not provided") else: report_filename = sys.argv[1] + build_url = sys.argv[2] with open(report_filename, 'r') as f: file = f.read() @@ -264,7 +266,7 @@ def complete_test_run(test_run_id): # create test run today = date.today() job_name = f"{os.getenv('JOB_NAME', 'longhorn-regression-test')}-{today}" - test_run_id = create_test_run(job_name, test_results) + test_run_id = create_test_run(job_name, test_results, build_url) print(f"test_run_id = {test_run_id}") # update test results to test run diff --git a/test_framework/Jenkinsfile b/test_framework/Jenkinsfile index 7254a1b264..9d8d6be984 100644 --- a/test_framework/Jenkinsfile +++ b/test_framework/Jenkinsfile @@ -180,7 +180,7 @@ node { } if(JOB_BASE_NAME != "longhorn-tests-regression") { - sh "docker exec ${JOB_BASE_NAME}-${BUILD_NUMBER} pipelines/utilities/junit_to_qase.py ${TF_VAR_tf_workspace}/longhorn-test-junit-report.xml" + sh "docker exec ${JOB_BASE_NAME}-${BUILD_NUMBER} pipelines/utilities/junit_to_qase.py ${TF_VAR_tf_workspace}/longhorn-test-junit-report.xml ${BUILD_URL}" } if(LONGHORN_INSTALL_METHOD == "custom") {