Skip to content

Commit

Permalink
Use variable QUEUE_CONNECTION_STRING
Browse files Browse the repository at this point in the history
  • Loading branch information
rettetdemdativ committed May 20, 2024
1 parent 8f8210e commit 0bf6d83
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/scraperResultTrigger/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"type": "queueTrigger",
"direction": "in",
"queueName": "scraper-result-queue",
"connection": "QUEUE_STORAGE_CONNECTION"
"connection": "QUEUE_CONNECTION_STRING"
},
{
"name": "msgOut",
"type": "queue",
"direction": "out",
"queueName": "new-listings-queue",
"connection": "QUEUE_STORAGE_CONNECTION"
"connection": "QUEUE_CONNECTION_STRING"
}
]
}
4 changes: 2 additions & 2 deletions backend/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from azure.cosmos import PartitionKey, CosmosClient, exceptions
from azure.storage.queue import QueueServiceClient

from .constants import COSMOS_CONNECTION_STRING, LISTINGS_FIXTURE, QUEUE_STORAGE_CONNECTION, SCRAPER_RESULTS_QUEUE_NAME, \
from .constants import COSMOS_CONNECTION_STRING, LISTINGS_FIXTURE, QUEUE_CONNECTION_STRING, SCRAPER_RESULTS_QUEUE_NAME, \
NEW_LISTINGS_QUEUE_NAME


Expand All @@ -27,7 +27,7 @@ def cosmos_db_client():

@pytest.fixture(scope="module")
def queue_service_client():
return QueueServiceClient.from_connection_string(QUEUE_STORAGE_CONNECTION)
return QueueServiceClient.from_connection_string(QUEUE_CONNECTION_STRING)


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion backend/test/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

COSMOS_CONNECTION_STRING = os.getenv("CONNECTION_STRING", default="AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;")
QUEUE_STORAGE_CONNECTION = os.getenv("QUEUE_STORAGE_CONNECTION", default="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;")
QUEUE_CONNECTION_STRING = os.getenv("QUEUE_CONNECTION_STRING", default="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;")

API_BASE_URL = os.getenv("API_BASE_URL", default="http://localhost:8000/api")

Expand Down
4 changes: 2 additions & 2 deletions backend/test/prepare_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from azure.cosmos import CosmosClient, PartitionKey
from azure.storage.queue import QueueServiceClient

from constants import COSMOS_CONNECTION_STRING, QUEUE_STORAGE_CONNECTION, SCRAPER_RESULTS_QUEUE_NAME, \
from constants import COSMOS_CONNECTION_STRING, QUEUE_CONNECTION_STRING, SCRAPER_RESULTS_QUEUE_NAME, \
NEW_LISTINGS_QUEUE_NAME

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Expand All @@ -21,7 +21,7 @@
)

# Assure the queues are created
queue_client = QueueServiceClient.from_connection_string(QUEUE_STORAGE_CONNECTION)
queue_client = QueueServiceClient.from_connection_string(QUEUE_CONNECTION_STRING)
existing_queues = [x["name"] for x in queue_client.list_queues()]

expected_queues = [SCRAPER_RESULTS_QUEUE_NAME, NEW_LISTINGS_QUEUE_NAME]
Expand Down
2 changes: 1 addition & 1 deletion backend/test/test.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "custom",
"AzureWebJobsStorage": "",
"QUEUE_STORAGE_CONNECTION": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;",
"QUEUE_CONNECTION_STRING": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;",
"COSMOS_DB_CONNECTION": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;"
}
}
Expand Down

0 comments on commit 0bf6d83

Please sign in to comment.