Skip to content

Commit 46cc0c8

Browse files
workflow ignore pydatalab_testing=true
Try fix .env PYDATALAB_TESTING Try fix .env PYDATALAB_TESTING Add temp. debug Add temp. debug Add temp. debug Add temp. debug Add temp. debug Add temp. debug Add temp. debug
1 parent 3cad406 commit 46cc0c8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
files: docker-compose.yml
150150
load: true
151151
source: .
152-
targets: 'app,api,database'
152+
targets: "app,api,database"
153153
set: |
154154
app.cache-from=type=gha,scope=${{ github.ref_name }}-${{ matrix.browser-backend }}-build-app
155155
app.cache-from=type=gha,scope=main-${{ matrix.browser-backend }}-build-app

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ services:
4141
- backend
4242
environment:
4343
- PYDATALAB_MONGO_URI=mongodb://database:27017/datalabvue
44+
- PYDATALAB_TESTING=${PYDATALAB_TESTING:-false}
4445

4546
database:
4647
profiles: ["prod"]

pydatalab/src/pydatalab/config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,17 @@ def settings_customise_sources(
325325
):
326326
return (init_settings, env_settings, config_file_settings, file_secret_settings)
327327

328+
@field_validator("TESTING", mode="before")
329+
@classmethod
330+
def ensure_testing_from_env(cls, v):
331+
"""Ensure TESTING is read from environment for Docker compatibility."""
332+
import os
333+
334+
if v is True:
335+
return True
336+
env_value = os.getenv("PYDATALAB_TESTING", "false").lower()
337+
return env_value == "true"
338+
328339
@model_validator(mode="before")
329340
@classmethod
330341
def deactivate_backup_strategies_during_testing(cls, values):

0 commit comments

Comments
 (0)