Skip to content

Commit 03d61f0

Browse files
committed
setup and tests
1 parent 35b6ce4 commit 03d61f0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

services/web/server/src/simcore_service_webserver/application.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def create_application() -> web.Application:
195195
def create_application_auth() -> web.Application:
196196
app = create_safe_application()
197197
setup_settings(app)
198+
setup_app_tracing(app) # WARNING: must be UPPERMOST middleware
199+
198200
setup_rest(app)
199201
setup_db(app)
200202

services/web/server/tests/unit/with_dbs/03/test_login_auth_app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def app_environment_for_wb_authz_service_dict(
4444
== "WEBSERVER_AUTHZ_APP_FACTORY"
4545
)
4646

47+
# expected tracing in the docker-environ BUT we will disable it for tests
48+
assert "WEBSERVER_TRACING" in docker_compose_service_environment_dict
49+
assert (
50+
"TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT"
51+
in docker_compose_service_environment_dict
52+
)
53+
4754
return {
4855
**docker_compose_service_environment_dict,
4956
# NOTE: TEST-stack uses different env-vars
@@ -55,7 +62,7 @@ def app_environment_for_wb_authz_service_dict(
5562
"POSTGRES_USER": postgres_cfg["user"],
5663
"POSTGRES_PASSWORD": postgres_cfg["password"],
5764
"HOSTNAME": docker_compose_service_hostname,
58-
# TODO: add everything coming from Dockerfile?
65+
"WEBSERVER_TRACING": "null", # BUT we will disable it for tests
5966
}
6067

6168

@@ -83,6 +90,7 @@ def app_environment_for_wb_authz_service(
8390
assert settings.WEBSERVER_DB is not None
8491
assert settings.WEBSERVER_SESSION is not None
8592
assert settings.WEBSERVER_SECURITY is not None
93+
assert settings.WEBSERVER_TRACING is None, "No tracing for tests"
8694

8795
return mocked_envs
8896

0 commit comments

Comments
 (0)