Skip to main content

scalio-selftest

Test mode of the Scalio apps (scalio-docs ADR 0053, concepts/test-mode.md): on our test instances (never dev, demo or production) 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 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
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
ERROR_REPORT_URL, ERROR_REPORT_TOKEN failed checks go to Scalio Monitor as errors of kind e2e (one GitHub issue per new group, label e2e, cockpit tab «Fehler»). There are no mails.
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.2.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.2.0
File Size Uploaded Provenance Actions
scalio_selftest-0.2.0.tar.gz 22.8 kB With provenance Details for scalio_selftest-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 44.3 kB

Release files / scalio_selftest-0.2.0.tar.gz

Download URL scalio_selftest-0.2.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d37c82556f15f9f5a19cca74c41e4ab27501bbccc03ed93bb3cd75b11d7d8ff6
BLAKE2b-256 checksum
How to use checksums
3136bb2c4880aff1e72a4d90f01e5e9c1a859c46dce002261535a9b29664cc8a
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 Nov 1, 2026.

Transparency log

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

Download URL scalio_selftest-0.2.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84d26ead68b767fea3e7426b62a6ab492dab35461399d338f1a662ed0261e44d
BLAKE2b-256 checksum
How to use checksums
e4230d390975ac8d24d88c7cba5d47f62347c2370746bf00497a2d9fe9aad0a6
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 Nov 1, 2026.

Transparency log

Security for scalio-selftest 0.2.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.2.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 Nov 1, 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.2.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