Add end-to-end integration test harness against a real server (#54) #184
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| dashboard: | |
| name: Dashboard tests (pytest + coverage) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dashboard with test extras | |
| run: pip install -e "build/dashboard[test]" | |
| - name: Run pytest with coverage gate | |
| working-directory: build/dashboard | |
| run: python -m pytest --cov=mining_dashboard --cov-report=term-missing --cov-fail-under=80 | |
| - name: Fake-daemon contract test (real clients vs controllable fakes) | |
| # Points the real Monero/Tari clients at the integration fakes and asserts they parse | |
| # every state (synced/syncing/down). Docker-free, so it runs on every PR (issue #54). | |
| run: PYTHONPATH=build/dashboard python -m pytest tests/integration/fakes -q | |
| frontend: | |
| name: Frontend logic tests (node --test) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| # Pure client logic (worker sort, tooltip formatting) lives in static/logic.mjs and is | |
| # tested with Node's built-in runner — no package.json/node_modules/build step. Component | |
| # rendering is covered by a manual browser smoke test, not here. | |
| - name: Run frontend logic tests | |
| run: node --test build/dashboard/tests/frontend/*.test.mjs | |
| dashboard-image: | |
| name: Dashboard image (Docker test stage) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the dashboard test stage (installs package + runs the suite in-container) | |
| run: docker build --target test ./build/dashboard | |
| shell: | |
| name: Shell tests (shellcheck + pithead suite) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # shellcheck is preinstalled on ubuntu-* runners, so we invoke it directly. | |
| # Avoid `apt-get update`, which refreshes every configured source (incl. | |
| # unrelated third-party mirrors like dl.google.com) and intermittently fails | |
| # the job when one is briefly out of sync — see issue #64. | |
| - name: Lint pithead and test scripts | |
| # Gate on warnings+errors (real issues); info-level style nits vary by shellcheck version. | |
| run: shellcheck --severity=warning pithead tests/stack/run.sh tests/stack/test_compose.sh tests/inventory.sh tests/integration/*.sh tests/integration/mini-stack/*.sh | |
| - name: Run pithead test suite | |
| run: bash tests/stack/run.sh | |
| - name: Run integration harness self-test | |
| # Pure-logic checks for the tests/integration/ harness (config rendering, matrix | |
| # coverage, redaction). The LIVE matrix (tests/integration/run.sh) needs a real test | |
| # server and runs as a gated/manual release gate (#54), not on every PR. | |
| run: bash tests/integration/selftest.sh | |
| - name: Check the test inventory is up to date | |
| # docs/test-inventory.md is generated from the suites; fail if a test was added/removed | |
| # without regenerating it (run `make test-inventory`). | |
| run: make test-inventory-check | |
| compose: | |
| name: Compose config + security hardening | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate docker-compose.yml interpolation + hardening invariants (#90) | |
| run: bash tests/stack/test_compose.sh |