Skip to main content

scalio-selftest

Test mode of the Scalio apps (scalio-docs ADR 0053, concepts/test-mode.md): on dev and test instances the app checks itself every night from the outside (API suite + browser smoke), keeps the history, compares each run with the one before, reports to Scalio Monitor and shows everything on the page «Tests» (@scalio-cloud/ui). Modelled on the Nexus self-check (backend/e2e_selfcheck.py, backend/test.py, backend/ui_smoke.py).

import scalio_selftest as sst
from scalio_selftest import common

async def basics(ctx):
    await common.basics(ctx)
    await common.sign_in(ctx)
    await common.setup_closed(ctx)
    await common.rights(ctx, [common.Rule("GET", "/api/users", {"admin"})])

SELFTEST = sst.SelfTest(
    "citadel", db, [sst.Suite("Basis", basics)],
    accounts=[sst.account("citadel", "admin"), sst.account("citadel", "operator")],
    upsert_account=upsert, remove_accounts=remove_all,          # the app stores its users itself
    ui=sst.UiSmoke(pages=[sst.Page("/", "Übersicht"), sst.Page("/settings", "Einstellungen")]),
)

app.include_router(make_router(SELFTEST, require_admin))       # scalio_selftest.router, needs [fastapi]
await SELFTEST.startup()                                         # API and worker start: accounts on / off
JOBS += [("citadel_selftest", 30, SELFTEST.tick)]                # worker, under the job lease

Switches

Env Meaning
TEST_MODE SAFE (only the app's own data and simulated Microsoft layers) or FULL (also the Entra test tenant; only Markus sets it). Anything else: off.
SCALIO_STAGE must be dev or test, otherwise the test mode stays off even with TEST_MODE
TEST_E2E_PUBLIC_URL address the runner calls (default PUBLIC_URL)
TEST_E2E_RUN_HOUR nightly hour 0-23; default 2 on test, none on dev (only on a click)
TEST_E2E_TZ time zone of the hour, default Europe/Zurich
E2E_BROWSER_WS Playwright server of the host (container e2e-browser), e.g. ws://e2e-browser:3000/
E2E_MONITOR_KEY, E2E_MONITOR_TOKEN_FILE heartbeat to Scalio Monitor after every run
E2E_TRIGGER_TOKENS sha256 of the tokens the RC deploy may use for POST /api/e2e/trigger

Pieces

  • gate: the two switches above. The UI can lower FULL to SAFE, never raise it.
  • accounts: one hidden test account per role (e2e-<role>@<app>.e2e.scaliocloud.com, no MX), fresh password on every start, kept only in the app's database, removed when the test mode is off. totp() for test accounts with MFA.
  • store: MongoStore(db) (collections e2e_state, e2e_runs) or SqlStore(engine) (table e2e_docs, SqlStore.DDL, for Kontor). SelfTest takes a Motor database or a store.
  • runner: SelfTest (history of 30 runs, progress, request, config), Context with check(), client(role), defer() for clean-up, objects named with ctx.prefix (e2e-<run>).
  • common: checks every app runs: health, version, headers, sign-in per role, wrong password, rights matrix, first-run setup closed, reads without errors.
  • ui: browser smoke over E2E_BROWSER_WS in German (light) and English (dark): sign-in, pages render, no error page, no sharp s, console errors as WARN.
  • router: /api/e2e/status (public, verdict only), health, runs, progress, config, run, cancel (admin), trigger (deploy token).
  • monitor: heartbeat POST /ingest/heartbeat/<key>?status=ok|fail.

Result format (same as Nexus): {section, name, mode, status, detail} with PASS, FAIL, WARN, SKIP.

Metadata

Release files for scalio-selftest 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scalio-selftest 0.1.0
File Size Uploaded Provenance Actions
scalio_selftest-0.1.0.tar.gz 21.8 kB With provenance Details for scalio_selftest-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scalio-selftest 0.1.0
File Interpreter ABI Platform Actions
scalio_selftest-0.1.0-py3-none-any.whl Python 3 none any Details for scalio_selftest-0.1.0-py3-none-any.whl

Total release size: 42.5 kB

Release files / scalio_selftest-0.1.0.tar.gz

Download URL scalio_selftest-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
43016b6e7023dff24507bb58d45e82c0243c65ca65f3867a587cbf1b79f6f13e
BLAKE2b-256 checksum
How to use checksums
0886002d7590f9cc29c2047a873c971429eec6d9e36c13931d35ca63aa758834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / scalio_selftest-0.1.0-py3-none-any.whl

Download URL scalio_selftest-0.1.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecc62d3313ea9b3034b4768f6ad1369ebdd6a97bf3f083d981c72742403fc458
BLAKE2b-256 checksum
How to use checksums
bb30efaedeeda908c8bed89c68303227606d116c30294c65d49d49e1154a799d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for scalio-selftest 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scalio_selftest-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page