From cfd1eac444f981145d7f5c577cd34a2bb6d1c113 Mon Sep 17 00:00:00 2001 From: Leonardo Bartoli Date: Thu, 2 Nov 2023 19:28:39 +0100 Subject: [PATCH] Initial instant test support --- internal/webpagetest.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/webpagetest.py b/internal/webpagetest.py index 801c5b972..529843160 100644 --- a/internal/webpagetest.py +++ b/internal/webpagetest.py @@ -574,8 +574,11 @@ def process_job_json(self, test_json): job['location'] = self.options.location if self.scheduler_node is not None and 'saas_test_id' in job: job['saas_node_id'] = self.scheduler_node + if self.scheduler_node is not None and 'instant_test_id' in job: + job['saas_node_id'] = self.scheduler_node + # For CLI tests, write out the raw job file - if self.options.testurl or self.options.testspec or 'saas_test_id' in job: + if self.options.testurl or self.options.testspec or 'saas_test_id' in job or 'intant_test_id' in job: if not os.path.isdir(self.workdir): os.makedirs(self.workdir) job_path = os.path.join(self.workdir, 'job.json') @@ -954,6 +957,17 @@ def get_task(self, job): task['page_data']['saas_device_type_id'] = job['saas_device_type_id'] else: task['page_data']['saas_device_type_id'] = 0 + # Pass-through the Instant test fields + if 'instant_test_id' in job: + task['page_data']['instant_test_id'] = job['instant_test_id'] + if 'saas_node_id' in job: + task['page_data']['saas_node_id'] = job['saas_node_id'] + if 'saas_device_type_id' in job: + task['page_data']['saas_device_type_id'] = job['saas_device_type_id'] + else: + task['page_data']['saas_device_type_id'] = 0 + if 'instant_division_id' in job: + task['page_data']['instant_division_id'] = job['instant_division_id'] self.test_run_count += 1 if task is None and self.job is not None: self.upload_test_result()