OP-3426 - added support for automatic tests into GlobalJobPreLoad

Jobs sent to DL must propagate flag IS_TEST to note that job is an automatic tests, it should use different DBs from regular jobs.
This commit is contained in:
Petr Kalis 2022-10-19 13:39:57 +02:00
parent 29ca3f8556
commit 76de4e4bbb
8 changed files with 30 additions and 8 deletions

View file

@ -153,7 +153,8 @@ def get_openpype_global_settings(url: str) -> dict:
# Create mongo connection
client = MongoClient(url, **kwargs)
# Access settings collection
col = client["openpype"]["settings"]
openpype_db = os.environ.get("OPENPYPE_DATABASE_NAME") or "openpype"
col = client[openpype_db]["settings"]
# Query global settings
global_settings = col.find_one({"type": "global_settings"}) or {}
# Close Mongo connection