From abce76ae2085c6d8171949955d5918186170c1c3 Mon Sep 17 00:00:00 2001 From: ianlongden Date: Fri, 27 Jan 2023 08:59:35 -0500 Subject: [PATCH] fixes --- .env.local.deb | 56 ++++++++++++++++++++++++++++++++++ tests/api/test_search_dates.py | 18 +++++------ 2 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 .env.local.deb diff --git a/.env.local.deb b/.env.local.deb new file mode 100644 index 000000000..7d57d5722 --- /dev/null +++ b/.env.local.deb @@ -0,0 +1,56 @@ +COMPOSE_PROJECT_NAME=agr-literature-test + +REG=100225593120.dkr.ecr.us-east-1.amazonaws.com +TAG=latest +ALLIANCE_RELEASE=latest + +RESOURCE_DESCRIPTOR_URL='https://raw.githubusercontent.com/alliance-genome/agr_schemas/master/resourceDescriptors.yaml' + +OKTA_DOMAIN='dev-30456587.okta.com/oauth2/default' +OKTA_API_AUDIENCE='api://default' + +# Envstate should either be build or prod +ENV_STATE=test +HOST=agr_literature + +PSQL_USERNAME=postgres +PSQL_PASSWORD=postgres +# postgres as internal to docker network +PSQL_HOST=postgres +PSQL_PORT=5433 +PSQL_DATABASE=literature_subset + +PGADMIN_DEFAULT_EMAIL=your@email.com +PGADMIN_DEFAULT_PASSWORD=password +PGADMIN_PORT=8882 + +SCHEMA='/path/to/schema.json' + +ELASTICSEARCH_HOST=elasticsearch +ELASTICSEARCH_PORT=9200 +ELASTICSEARCH_INDEX=test_references_index + +REDIS_HOST=redis +REDIS_PORT=6379 +REDIS_DB=0 +REDIS_AUTH=password + +API_PORT=8080 +API_SERVER=literature_api + +DEBEZIUM_VERSION=1.9 +DEBEZIUM_CONNECTOR_HOST=dbz_connector +DEBEZIUM_CONNECTOR_PORT=8083 +DEBEZIUM_INDEX_NAME=test_references_index +DEBEZIUM_KSQLDB_HOST=dbz_ksql_server +DEBEZIUM_KSQLDB_PORT=8088 + +OKTA_CLIENT_ID= +OKTA_CLIENT_SECRET= + +TEST_CLEANUP=true + +ALLIANCE_FMS_RELEASE=5.2.2 +ID_MATI_URL= +LOG_PATH=./ +XML_PATH=./ diff --git a/tests/api/test_search_dates.py b/tests/api/test_search_dates.py index 9de44a539..c1ce043ed 100644 --- a/tests/api/test_search_dates.py +++ b/tests/api/test_search_dates.py @@ -24,7 +24,7 @@ def initialize_elasticsearch(): date5_str = '2022-12-31' date1 = int(datetime.strptime(date1_str, '%Y-%m-%d').timestamp()) * 1000000 date2 = int(datetime.strptime(date2_str, '%Y-%m-%d').timestamp()) * 1000000 - date3 = int(datetime.strptime(date3_str, '%Y-%m-%d').timestamp()) * 1000000 + # date3 = int(datetime.strptime(date3_str, '%Y-%m-%d').timestamp()) * 1000000 date4 = int(datetime.strptime(date4_str, '%Y-%m-%d').timestamp()) * 1000000 date5 = int(datetime.strptime(date5_str, '%Y-%m-%d').timestamp()) * 1000000 doc1 = { @@ -107,14 +107,14 @@ def test_search_references_with_date_pubmed_arrive(self, initialize_elasticsearc with TestClient(app) as client: search_data = { "query": "", - "facets_limits":{"pubmed_types.keyword":10, - "category.keyword":10, - "pubmed_publication_status.keyword":10, - "authors.name.keyword":10}, - "author_filter":"", - "query_fields":"All", - "date_pubmed_arrive":["2022-01-01T00:00:00.000Z", - "2022-03-31T03:59:59.999Z"] + "facets_limits": {"pubmed_types.keyword": 10, + "category.keyword": 10, + "pubmed_publication_status.keyword": 10, + "authors.name.keyword": 10}, + "author_filter": "", + "query_fields": "All", + "date_pubmed_arrive": ["2022-01-01T00:00:00.000Z", + "2022-03-31T03:59:59.999Z"] } res = client.post(url="/search/references/", json=search_data, headers=auth_headers).json() assert "hits" in res