test: add automated api tester

This commit is contained in:
truetype committed 2026-02-05 11:32:21 +01:00
1 parent 882efeb963
commit 572d551a2c
7 files changed
+113 -4

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
echo "Installing dependencies..."
python -m pip install -r requirements.txt >/dev/null
echo "Running pytest..."
python -m pytest tests
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
# Helper script that pushes the current branch to the Gitea remote using a personal
# access token stored in $GITEA_TOKEN. Keeps the token out of shell history.
if [[ -z "${GITEA_TOKEN:-}" ]]; then
echo "Missing GITEA_TOKEN (export it before running this script)." >&2
exit 1
fi
readonly REMOTE_URL="https://truetype:${GITEA_TOKEN}@gitea.solarpi.net/truetype/dashgradio_tunnel.git"
readonly BRANCH="${1:-main}"
echo "Pushing branch ${BRANCH} to Gitea..."
git push "${REMOTE_URL}" "${BRANCH}"