ci: run traffic-controller unit tests as a gate job #347

Merged
JMR-dev merged 1 commits from ci-346-traffic-control-tests into main 2026-07-05 03:59:01 +00:00
JMR-dev commented 2026-07-05 03:36:10 +00:00 (Migrated from github.com)

Closes #346

Adds a fast traffic-control-tests job to .github/workflows/ci.yml that runs the 37 pure-stdlib-Python unit tests for .github/scripts/traffic_control.py (added by #345 / #342, now merged) on every PR — no emulator, no Gradle, runs in seconds — and wires it into the ci-passed gate's needs: list so a regression in the traffic-controller logic blocks merge instead of only being caught locally.

Base branch note: this was originally developed against #345's branch (ci-342-traffic-control-python), per the ticket's fallback instructions, since #345 hadn't merged yet when work started. #345 merged (dc21411) partway through, so the branch was rebased onto main and retargeted here.

Job added

  traffic-control-tests:
    name: Traffic-control unit tests
    needs: traffic-control # order after runner-priority orchestration (P0/broken/draft preempt; P1–P9 hold-back)
    runs-on: ubuntu-latest
    steps:
      - name: Check out source
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

      - name: Set up Python
        uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
        with:
          python-version: "3.x"

      - name: Run traffic-controller unit tests
        run: python -m unittest discover -s .github/scripts -p 'test_*.py' -v

traffic-control-tests also gets needs: traffic-control, matching every other job that feeds ci-passed (consistent with the runner-priority hold-back scheme, even though this job itself is cheap/fast).

Test plan

  • python -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))" parses clean
  • python -m unittest discover -s .github/scripts -p 'test_*.py' -v — 37/37 pass locally
  • ci-passed's needs: list and diagnostic-echo step updated to include traffic-control-tests, matching the existing pattern for the other jobs
  • Diff against main is exactly the new job + the gate wiring — no other jobs touched

🤖 Generated with Claude Code

Closes #346 Adds a fast `traffic-control-tests` job to `.github/workflows/ci.yml` that runs the 37 pure-stdlib-Python unit tests for `.github/scripts/traffic_control.py` (added by #345 / #342, now merged) on every PR — no emulator, no Gradle, runs in seconds — and wires it into the `ci-passed` gate's `needs:` list so a regression in the traffic-controller logic blocks merge instead of only being caught locally. **Base branch note:** this was originally developed against #345's branch (`ci-342-traffic-control-python`), per the ticket's fallback instructions, since #345 hadn't merged yet when work started. #345 merged (`dc21411`) partway through, so the branch was rebased onto `main` and retargeted here. ## Job added ```yaml traffic-control-tests: name: Traffic-control unit tests needs: traffic-control # order after runner-priority orchestration (P0/broken/draft preempt; P1–P9 hold-back) runs-on: ubuntu-latest steps: - name: Check out source uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: "3.x" - name: Run traffic-controller unit tests run: python -m unittest discover -s .github/scripts -p 'test_*.py' -v ``` `traffic-control-tests` also gets `needs: traffic-control`, matching every other job that feeds `ci-passed` (consistent with the runner-priority hold-back scheme, even though this job itself is cheap/fast). ## Test plan - [x] `python -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"` parses clean - [x] `python -m unittest discover -s .github/scripts -p 'test_*.py' -v` — 37/37 pass locally - [x] `ci-passed`'s `needs:` list and diagnostic-echo step updated to include `traffic-control-tests`, matching the existing pattern for the other jobs - [x] Diff against `main` is exactly the new job + the gate wiring — no other jobs touched 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.