Skip to content

Commit

Permalink
Don't use our custom seqfetcher endpoint when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaitodor committed Dec 14, 2023
1 parent 961ca9c commit eef7272
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
args: --extend-ignore E501,E741

- name: Run Tests
run: ./fetch_refseq.sh && python -m pytest
run: python -m pytest

deploy:
name: Deploy to dev
Expand Down
13 changes: 8 additions & 5 deletions app/input_normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import hgvs.assemblymapper
import os
from utilities.SPDI_Normalization import get_normalized_spdi

# Set the HGVS_SEQREPO_URL env var so the hgvs library will use the local `utilities/seqfetcher` endpoint instead of
# making NCBI API calls.
port = os.getenv('PORT', 5000) # The localhost debugger starts the app on port 5000
os.environ['HGVS_SEQREPO_URL'] = f"http://localhost:{port}/utilities/seqfetcher"
import sys

# TODO: Figure out a way to launch this endpoint when running the tests
if "pytest" not in sys.modules:
# Set the HGVS_SEQREPO_URL env var so the hgvs library will use the local `utilities/seqfetcher` endpoint instead of
# making NCBI API calls.
port = os.getenv('PORT', 5000) # The localhost debugger starts the app on port 5000
os.environ['HGVS_SEQREPO_URL'] = f"http://localhost:{port}/utilities/seqfetcher"

database_schema = os.getenv('UTA_DATABASE_SCHEMA', 'uta_20210129b')
# Use the biocommons UTA database if we don't specify a custom one.
Expand Down

0 comments on commit eef7272

Please sign in to comment.