Commit 0a963eeb authored by David Mendez's avatar David Mendez
Browse files

Make sure to also not save url shortening statistics for entities join

parent 8f4b61e2
......@@ -61,7 +61,7 @@ def get_tiny_hash_to_related_items(destination_entity_browser_state_template,
join_state_hash = get_join_state_hash(ids, query_parameters['destination_query_generator'],
query_parameters['settings_path'], query_parameters['browser_name'],
destination_entity_browser_state_template,
previous_hash)
previous_hash, is_test)
cache.fail_proof_set(key=cache_key, value=join_state_hash, timeout=RUN_CONFIG.get('entities_join_cache_seconds'))
if not is_test:
......@@ -216,7 +216,7 @@ def fail_if_null(value, value_name, parsed_origin_entity, parsed_destination_ent
def get_join_state_hash(ids, destination_query_generator, settings_path, browser_name,
destination_entity_browser_state_template,
previous_hash):
previous_hash, is_test=False):
"""
:param ids: list of its for the join
:param destination_query_generator: function that generates the join query from a list of ids
......@@ -224,6 +224,7 @@ def get_join_state_hash(ids, destination_query_generator, settings_path, browser
:param browser_name: name of the destination browser used to build the desired url
:param destination_entity_browser_state_template: template to build the url for the destination entity browser
:param previous_hash: hash of the state that originated this join of entities
:param is_test: indicates if it is a test request
:return: the hash for the query state used for the join
"""
desired_state = {
......@@ -250,15 +251,16 @@ def get_join_state_hash(ids, destination_query_generator, settings_path, browser
)
hashable_part = f'#{destination_entity_browser_state_url.split("#")[1]}'
return get_destination_url_hash(hashable_part)
return get_destination_url_hash(hashable_part, is_test)
def get_destination_url_hash(hashable_part):
def get_destination_url_hash(hashable_part, is_test=False):
"""
:param hashable_part: of the destination url generated
:param is_test: indicates if it is a test request
:return: a hash generated using the hasable url part of the destination browser
"""
shortening_response = url_shortener.shorten_url(hashable_part)
shortening_response = url_shortener.shorten_url(hashable_part, is_test)
return shortening_response['hash']
......
......@@ -40,7 +40,6 @@ def run():
fun_test_organism_taxonomy_target_classification, fun_test_protein_target_classification,
fun_test_covid_entities_records, fun_test_database_summary, fun_test_entities_records,
fun_test_get_all_properties, fun_test_identify_separator, fun_test_entities_join_all_tests]:
test_module.run_test(ARGS.server_base_path, ARGS.delayed_jobs_server_base_path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment