Skip to content

Commit

Permalink
Initial instant test support
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoli79 committed Nov 2, 2023
1 parent 4ac1576 commit cfd1eac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion internal/webpagetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit cfd1eac

Please sign in to comment.