diff --git a/dcicutils/_version.py b/dcicutils/_version.py index 479e68301..68a395623 100644 --- a/dcicutils/_version.py +++ b/dcicutils/_version.py @@ -1,4 +1,4 @@ """Version information.""" # The following line *must* be the last in the module, exactly as formatted: -__version__ = "0.7.4" +__version__ = "0.7.5" diff --git a/dcicutils/log_utils.py b/dcicutils/log_utils.py index bd3fc8e2a..eda420bb9 100644 --- a/dcicutils/log_utils.py +++ b/dcicutils/log_utils.py @@ -163,7 +163,7 @@ def add_log_uuid(logger, log_method, event_dict): # configure structlog to use its formats for stdlib logging and / or structlog logging -def set_logging(es_server=None, in_prod=False, level=logging.INFO, log_name=None, log_dir=None): +def set_logging(es_server=None, in_prod=False, level=logging.WARN, log_name=None, log_dir=None): ''' Set logging is a function to be used everywhere, to encourage all subsytems to generate structured JSON logs, for easy insertion into ES for searching and @@ -256,9 +256,6 @@ def set_logging(es_server=None, in_prod=False, level=logging.INFO, log_name=None ''' # set logging level - - - # below could be used ot redirect logging to a file if desired if log_name is None: log_name = __name__ diff --git a/test/test_ff_utils.py b/test/test_ff_utils.py index b3bfeb5b9..7543f9417 100644 --- a/test/test_ff_utils.py +++ b/test/test_ff_utils.py @@ -371,7 +371,7 @@ def test_search_metadata(integrated_ff): @pytest.mark.integrated def test_get_search_generator(integrated_ff): - search_url = integrated_ff['ff_key']['server'] + '/search/?type=OntologyTerm' + search_url = integrated_ff['ff_key']['server'] + '/search/?type=FileFastq' generator1 = ff_utils.get_search_generator(search_url, auth=integrated_ff['ff_key'], page_limit=25) list_gen1 = list(generator1) assert len(list_gen1) > 0 @@ -388,11 +388,11 @@ def test_get_search_generator(integrated_ff): all_gen2 = [page for pages in list_gen2 for page in pages] # noqa assert len(all_gen1) == len(all_gen2) # use a limit in the search - search_url += '&limit=33' + search_url += '&limit=21' generator3 = ff_utils.get_search_generator(search_url, auth=integrated_ff['ff_key']) list_gen3 = list(generator3) all_gen3 = [page for pages in list_gen3 for page in pages] # noqa - assert len(all_gen3) == 33 + assert len(all_gen3) == 21 # make sure that all results are unique all_gen3_uuids = set([item['uuid'] for item in all_gen3]) assert len(all_gen3_uuids) == len(all_gen3) @@ -514,8 +514,8 @@ def test_get_es_search_generator(integrated_ff): es_url = ff_utils.get_health_page(key=integrated_ff['ff_key'])['elasticsearch'] es_client = es_utils.create_es_client(es_url, use_aws_auth=True) es_query = {'query': {'match_all': {}}, 'sort': [{'_uid': {'order': 'desc'}}]} - # search for all ontology terms with a low pagination size - es_gen = ff_utils.get_es_search_generator(es_client, 'ontology_term', + # search for all fastqs with a low pagination size + es_gen = ff_utils.get_es_search_generator(es_client, 'file_fastq', es_query, page_size=7) list_gen = list(es_gen) assert len(list_gen) > 0 @@ -526,7 +526,7 @@ def test_get_es_search_generator(integrated_ff): assert len(page) == 7 all_es_uuids = set([page['_source']['uuid'] for pages in list_gen for page in pages]) # noqa # make sure all items are unique and len matches ff search - search_res = ff_utils.search_metadata('/search/?type=OntologyTerm&frame=object', + search_res = ff_utils.search_metadata('/search/?type=FileFastq&frame=object', key=integrated_ff['ff_key']) search_uuids = set(hit['uuid'] for hit in search_res) assert all_es_uuids == search_uuids