@@ -2765,6 +2765,30 @@ def test_koji_build_end_downstream(
27652765 ** common_payload_no_compose ,
27662766 }
27672767
2768+ shared_tests_repo = "https://forge.fedoraproject.org/ci/shared-tests"
2769+
2770+ payload_rmdepcheck = {
2771+ "test" : {
2772+ "tmt" : {
2773+ "url" : shared_tests_repo ,
2774+ "ref" : "stg" ,
2775+ "name" : "/rmdepcheck" ,
2776+ },
2777+ },
2778+ ** common_payload_no_compose ,
2779+ }
2780+
2781+ payload_license_validate = {
2782+ "test" : {
2783+ "tmt" : {
2784+ "url" : shared_tests_repo ,
2785+ "ref" : "stg" ,
2786+ "name" : "/license-validate" ,
2787+ },
2788+ },
2789+ ** common_payload_no_compose ,
2790+ }
2791+
27682792 payload_custom = {
27692793 "test" : {
27702794 "tmt" : {
@@ -2849,6 +2873,26 @@ def test_koji_build_end_downstream(
28492873 json = {"id" : pipeline_id },
28502874 ),
28512875 ).once ()
2876+ flexmock (TestingFarmClient ).should_receive (
2877+ "send_testing_farm_request" ,
2878+ ).with_args (endpoint = "requests" , method = "POST" , data = payload_rmdepcheck ).and_return (
2879+ RequestResponse (
2880+ status_code = 200 ,
2881+ ok = True ,
2882+ content = json .dumps ({"id" : pipeline_id }).encode (),
2883+ json = {"id" : pipeline_id },
2884+ ),
2885+ ).once ()
2886+ flexmock (TestingFarmClient ).should_receive (
2887+ "send_testing_farm_request" ,
2888+ ).with_args (endpoint = "requests" , method = "POST" , data = payload_license_validate ).and_return (
2889+ RequestResponse (
2890+ status_code = 200 ,
2891+ ok = True ,
2892+ content = json .dumps ({"id" : pipeline_id }).encode (),
2893+ json = {"id" : pipeline_id },
2894+ ),
2895+ ).once ()
28522896 flexmock (TestingFarmClient ).should_receive (
28532897 "send_testing_farm_request" ,
28542898 ).with_args (endpoint = "requests" , method = "POST" , data = payload_custom ).and_return (
@@ -2928,12 +2972,48 @@ def test_koji_build_end_downstream(
29282972 .once ()
29292973 .mock ()
29302974 )
2975+ tft_test_run_model_rmdepcheck = (
2976+ flexmock (
2977+ id = 9 ,
2978+ koji_builds = [koji_build_pr_downstream ],
2979+ status = TestingFarmResult .new ,
2980+ target = distro ,
2981+ data = {"fedora_ci_test" : "rmdepcheck" },
2982+ )
2983+ .should_receive ("set_pipeline_id" )
2984+ .with_args (pipeline_id )
2985+ .once ()
2986+ .mock ()
2987+ .should_receive ("set_status" )
2988+ .with_args (TestingFarmResult .queued )
2989+ .once ()
2990+ .mock ()
2991+ )
2992+ tft_test_run_model_license_validate = (
2993+ flexmock (
2994+ id = 10 ,
2995+ koji_builds = [koji_build_pr_downstream ],
2996+ status = TestingFarmResult .new ,
2997+ target = distro ,
2998+ data = {"fedora_ci_test" : "license-validate" },
2999+ )
3000+ .should_receive ("set_pipeline_id" )
3001+ .with_args (pipeline_id )
3002+ .once ()
3003+ .mock ()
3004+ .should_receive ("set_status" )
3005+ .with_args (TestingFarmResult .queued )
3006+ .once ()
3007+ .mock ()
3008+ )
29313009 group = flexmock (
29323010 grouped_targets = [
29333011 tft_test_run_model_installability ,
29343012 tft_test_run_model_custom ,
29353013 tft_test_run_model_rpminspect ,
29363014 tft_test_run_model_rpmlint ,
3015+ tft_test_run_model_rmdepcheck ,
3016+ tft_test_run_model_license_validate ,
29373017 ]
29383018 )
29393019 flexmock (TFTTestRunGroupModel ).should_receive ("create" ).with_args (
@@ -2992,6 +3072,32 @@ def test_koji_build_end_downstream(
29923072 "fedora_ci_test" : "rpmlint" ,
29933073 },
29943074 ).and_return (tft_test_run_model_rpmlint ).once ()
3075+ flexmock (TFTTestRunTargetModel ).should_receive ("create" ).with_args (
3076+ pipeline_id = None ,
3077+ identifier = None ,
3078+ status = TestingFarmResult .new ,
3079+ target = distro ,
3080+ web_url = None ,
3081+ test_run_group = group ,
3082+ koji_build_targets = [koji_build_pr_downstream ],
3083+ data = {
3084+ "base_project_url" : "https://src.fedoraproject.org/rpms/packit" ,
3085+ "fedora_ci_test" : "rmdepcheck" ,
3086+ },
3087+ ).and_return (tft_test_run_model_rmdepcheck ).once ()
3088+ flexmock (TFTTestRunTargetModel ).should_receive ("create" ).with_args (
3089+ pipeline_id = None ,
3090+ identifier = None ,
3091+ status = TestingFarmResult .new ,
3092+ target = distro ,
3093+ web_url = None ,
3094+ test_run_group = group ,
3095+ koji_build_targets = [koji_build_pr_downstream ],
3096+ data = {
3097+ "base_project_url" : "https://src.fedoraproject.org/rpms/packit" ,
3098+ "fedora_ci_test" : "license-validate" ,
3099+ },
3100+ ).and_return (tft_test_run_model_license_validate ).once ()
29953101
29963102 # check if packit-service set correct PR statuses
29973103 flexmock (StatusReporter ).should_receive ("set_status" ).with_args (
@@ -3057,6 +3163,34 @@ def test_koji_build_end_downstream(
30573163 check_name = "Packit-stg - rpmlint" ,
30583164 target_branch = koji_target ,
30593165 ).once ()
3166+ flexmock (StatusReporter ).should_receive ("set_status" ).with_args (
3167+ state = BaseCommitStatus .running ,
3168+ description = "Submitting the tests ..." ,
3169+ url = "https://dashboard.localhost/jobs/testing-farm/9" ,
3170+ check_name = "Packit-stg - rmdepcheck" ,
3171+ target_branch = koji_target ,
3172+ ).once ()
3173+ flexmock (StatusReporter ).should_receive ("set_status" ).with_args (
3174+ state = BaseCommitStatus .running ,
3175+ description = "Tests have been submitted ..." ,
3176+ url = "https://dashboard.localhost/jobs/testing-farm/9" ,
3177+ check_name = "Packit-stg - rmdepcheck" ,
3178+ target_branch = koji_target ,
3179+ ).once ()
3180+ flexmock (StatusReporter ).should_receive ("set_status" ).with_args (
3181+ state = BaseCommitStatus .running ,
3182+ description = "Submitting the tests ..." ,
3183+ url = "https://dashboard.localhost/jobs/testing-farm/10" ,
3184+ check_name = "Packit-stg - license-validate" ,
3185+ target_branch = koji_target ,
3186+ ).once ()
3187+ flexmock (StatusReporter ).should_receive ("set_status" ).with_args (
3188+ state = BaseCommitStatus .running ,
3189+ description = "Tests have been submitted ..." ,
3190+ url = "https://dashboard.localhost/jobs/testing-farm/10" ,
3191+ check_name = "Packit-stg - license-validate" ,
3192+ target_branch = koji_target ,
3193+ ).once ()
30603194
30613195 urls .DASHBOARD_URL = "https://dashboard.localhost"
30623196
0 commit comments