CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 7s
CI & Build / Python tests (push) Successful in 15s
CI & Build / integration (push) Successful in 45s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 4m17s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 7m33s
Desktop (Tauri) / Update manifest (push) Successful in 7s
Android / Kotlin + Rust (APK) (push) Successful in 11m25s
Step 2 of milestone 481. The operator chose a full rename (Scribe note 5071), so this goes past the display strings into the identities: - src/thoughtsync → src/inkwell; every import, the Dockerfile and both compose commands, alembic env, pyproject - THOUGHTSYNC_* → INKWELL_* (database URL, secret key, log level, tag/port/bind) - container data dir /var/thoughtsync → /var/inkwell - image git.fabledsword.com/bvandeusen/inkwell; Postgres user/db default inkwell; CI's integration service follows - the files the image serves are inkwell.*. fetch-clients.sh still fetches the thoughtsync-named release assets, because the lanes that publish them are renamed in steps 3 and 4 - exports are written with app "inkwell" Two deliberate exceptions, both because data rides on them: - compose volumes are now named explicitly and overridable (INKWELL_DB_VOLUME, INKWELL_DATA_VOLUME), so a deployment installed as ThoughtSync points at the volumes and DB identity it already has. .env.example says exactly what to set - import still accepts app "thoughtsync", because exports written before the rename are backups. Tested both ways Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
77 lines
2.5 KiB
Python
77 lines
2.5 KiB
Python
import pytest
|
|
|
|
from inkwell.app import create_app
|
|
|
|
|
|
@pytest.fixture
|
|
def app():
|
|
return create_app()
|
|
|
|
|
|
async def test_health_ok(app):
|
|
client = app.test_client()
|
|
resp = await client.get("/api/health")
|
|
assert resp.status_code == 200
|
|
data = await resp.get_json()
|
|
assert data["status"] == "ok"
|
|
assert "version" in data
|
|
|
|
|
|
async def test_me_requires_auth(app):
|
|
client = app.test_client()
|
|
resp = await client.get("/api/auth/me")
|
|
assert resp.status_code == 401
|
|
|
|
|
|
async def test_unknown_api_route_404s(app):
|
|
client = app.test_client()
|
|
resp = await client.get("/api/does-not-exist")
|
|
assert resp.status_code == 404
|
|
|
|
|
|
# --- the version a running server reports ------------------------------------
|
|
#
|
|
# Note 3127 §5 removed version tags, so this string is the only answer to "which
|
|
# build is this?" and nothing exists to contradict it when it is wrong. That makes
|
|
# the FALLBACK the interesting case rather than the happy path: it used to be
|
|
# `__version__`, so a server run from a checkout reported `0.2.0` — a real-looking
|
|
# version naming no build anybody could obtain.
|
|
|
|
|
|
async def reported_version() -> str:
|
|
"""What a freshly built app tells /api/health it is.
|
|
|
|
Built per call rather than through the `app` fixture: the value is read from the
|
|
environment in `create_app`, so an app constructed before `monkeypatch` ran would
|
|
answer about the wrong environment.
|
|
"""
|
|
client = create_app().test_client()
|
|
return (await (await client.get("/api/health")).get_json())["version"]
|
|
|
|
|
|
async def test_the_version_is_whatever_the_environment_says(monkeypatch):
|
|
monkeypatch.setenv("APP_VERSION", "2026.08.29.0443")
|
|
assert await reported_version() == "2026.08.29.0443"
|
|
|
|
|
|
async def test_no_version_in_the_environment_reports_unknown(monkeypatch):
|
|
"""The honest "I cannot say", not a plausible default.
|
|
|
|
Also asserted against `__version__` by name rather than against the literal it
|
|
happens to hold, so bumping the packaging version cannot make this pass for the
|
|
wrong reason.
|
|
"""
|
|
from inkwell import __version__
|
|
|
|
monkeypatch.delenv("APP_VERSION", raising=False)
|
|
reported = await reported_version()
|
|
assert reported == "unknown"
|
|
assert reported != __version__
|
|
|
|
|
|
async def test_an_empty_version_reports_unknown_too(monkeypatch):
|
|
"""`APP_VERSION=` is what a mis-set build arg looks like, and an empty string
|
|
renders as a blank space rather than as a missing value."""
|
|
monkeypatch.setenv("APP_VERSION", "")
|
|
assert await reported_version() == "unknown"
|