Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/fleet-python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: fleet python tests

# Test verification for the Python suites under pkgs/fleet (#17753).
#
# The fleet book's testing chapter catalogues pkgs/fleet/tests/ (five
# suites: the broker heartbeat/lease SQL, the laptop-agent cutover gate
# for #16089, the fetch-failure parity suite for #16088, the Python CLI
# v1 selector contract, and the tailnet proxy env contract) plus the
# two pkgs/fleet/archer-slack suites as the package's Python test
# surface — but no workflow, flake check, or other runner ever executed
# them. This workflow runs all seven on every PR and push to main that
# touches pkgs/fleet/**.
#
# All seven suites are stdlib unittest with no network and no
# credentials; each file is run individually (the fleet-queue-backup
# pattern) so one suite's import-time failure cannot mask the others,
# and the run fails loudly if the enumeration ever comes up empty.

on:
push:
branches: [main]
paths:
[
pkgs/fleet/tests/**,
pkgs/fleet/archer-slack/**,
pkgs/fleet/crates/fleet-queue/src/turso_queue/**,
pkgs/fleet/laptop-agent.py,
.github/workflows/fleet-python-tests.yml,
]
pull_request:
paths:
[
pkgs/fleet/tests/**,
pkgs/fleet/archer-slack/**,
pkgs/fleet/crates/fleet-queue/src/turso_queue/**,
pkgs/fleet/laptop-agent.py,
.github/workflows/fleet-python-tests.yml,
]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: pkgs/fleet Python suites (#17753)
run: |
fail=0
count=0
for t in pkgs/fleet/tests/test_*.py pkgs/fleet/archer-slack/collector/test_*.py pkgs/fleet/archer-slack/puller/test_*.py; do
count=$((count + 1))
echo "== $t"
if python3 -I "$t"; then
echo "PASS: $t"
else
echo "::error::FAIL: $t"
fail=1
fi
done
echo "Ran $count Python test file(s)."
if [ "$count" -eq 0 ]; then
echo "::error::No test files matched — the suites were not run."
exit 1
fi
if [ "$fail" -ne 0 ]; then
echo "::error::fleet Python tests: at least one file failed (see above)."
exit 1
fi
echo "fleet Python tests: all $count files passed."