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

Update payload to v2 layout to run daily benchmark #154

Merged
merged 5 commits into from
Apr 26, 2024
Merged
Changes from 2 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
40 changes: 21 additions & 19 deletions runner_benchmark/token_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,27 @@
KEYS_FOLDER = './jwt-test-keys'

PAYLOAD = {
'user_id': 'benchmark-user',
'period_str': 'July 2019',
'period_id': '201907',
'collection_exercise_sid': str(uuid4()),
'case_id': str(uuid4()),
'case_type': 'HI',
'display_address': '68 Abingdon Road, Goathill',
'ru_ref': '123456789012A',
'ru_name': 'Integration Testing',
'ref_p_start_date': '2019-04-01',
'ref_p_end_date': '2019-11-30',
'return_by': '2019-12-06',
'trad_as': 'Benchmark Tests',
'employment_date': '1983-06-02',
'region_code': 'GB-ENG',
'language_code': 'en',
'roles': [],
'version': 'v2',
'account_service_url': 'http://upstream.url',
'variant_flags': {'sexual_identity': 'false'},
'case_id': str(uuid4()),
'collection_exercise_sid': str(uuid4()),
'response_id': str(uuid4()),
'survey_metadata': {
'data': {
'case_ref': '1000000000000001',
'form_type': '0001',
'period_id': '201907',
'period_str': 'July 2019',
'ref_p_start_date': '2019-04-01',
'ref_p_end_date': '2019-11-30',
'ru_name': 'Integration Testing',
'ru_ref': '123456789012A',
'trad_as': 'Benchmark Tests',
'user_id': 'benchmark-user',
'survey_id': '0',
'employment_date': '2019-04-01',
}
},
}


Expand Down Expand Up @@ -81,7 +83,7 @@ def _get_payload_with_params(schema_name, schema_url=None, **extra_payload):
datetime.now(tz=timezone.utc) + timedelta(days=7)
).isoformat() # 7 days from now in ISO 8601 format
for key, value in extra_payload.items():
payload_vars[key] = value
payload_vars['survey_metadata']['data'][key] = value
MebinAbraham marked this conversation as resolved.
Show resolved Hide resolved

return payload_vars

Expand Down
Loading