fix ci test
This commit is contained in:
@@ -17,9 +17,11 @@ from scripts.poo_db_adopt import POO_BASELINE_REVISION
|
||||
from scripts.run_migrations import run_all_migrations
|
||||
from tests.conftest import _make_alembic_config, _make_poo_alembic_config
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _read_yaml(path: str) -> dict:
|
||||
return yaml.safe_load(Path(path).read_text())
|
||||
return yaml.safe_load((PROJECT_ROOT / path).read_text())
|
||||
|
||||
|
||||
async def _run_lifespan(app) -> None:
|
||||
@@ -97,8 +99,8 @@ def _create_legacy_poo_db(database_path: Path) -> None:
|
||||
|
||||
|
||||
def test_compose_uses_migration_job_before_app() -> None:
|
||||
compose = _read_yaml("/home/tianyu/workspace/home-automation/docker-compose.yml")
|
||||
override = _read_yaml("/home/tianyu/workspace/home-automation/docker-compose.override.yml")
|
||||
compose = _read_yaml("docker-compose.yml")
|
||||
override = _read_yaml("docker-compose.override.yml")
|
||||
|
||||
migration_service = compose["services"]["migration"]
|
||||
app_service = compose["services"]["app"]
|
||||
@@ -111,8 +113,8 @@ def test_compose_uses_migration_job_before_app() -> None:
|
||||
|
||||
|
||||
def test_image_defaults_to_uvicorn_only() -> None:
|
||||
dockerfile = Path("/home/tianyu/workspace/home-automation/Dockerfile").read_text()
|
||||
entrypoint = Path("/home/tianyu/workspace/home-automation/docker/entrypoint.sh").read_text()
|
||||
dockerfile = (PROJECT_ROOT / "Dockerfile").read_text()
|
||||
entrypoint = (PROJECT_ROOT / "docker/entrypoint.sh").read_text()
|
||||
|
||||
assert 'CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]' in dockerfile
|
||||
assert 'exec "$@"' in entrypoint
|
||||
|
||||
Reference in New Issue
Block a user