Skip to content
Merged
Show file tree
Hide file tree
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
121 changes: 114 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
installer_go: ${{ steps.filter.outputs.installer_go }}
installer_cross: ${{ steps.filter.outputs.installer_cross }}
installer_webui: ${{ steps.filter.outputs.installer_webui }}
installer_macos: ${{ steps.filter.outputs.installer_macos }}
python: ${{ steps.filter.outputs.python }}
shell: ${{ steps.filter.outputs.shell }}
bootstrap: ${{ steps.filter.outputs.bootstrap }}
Expand Down Expand Up @@ -117,6 +118,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: dashboard/go.mod
cache-dependency-path: dashboard/go.sum
- run: test -z "$(gofmt -l .)"
- run: go vet ./...
- run: go test ./...
Expand All @@ -134,6 +136,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: installer/go.mod
cache-dependency-path: installer/go.sum
- run: test -z "$(gofmt -l .)"
- run: go vet ./...
# Task 5 braucht einen echten sshd fuer den Transport-Integrationstest;
Expand Down Expand Up @@ -171,8 +174,76 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: installer/go.mod
cache-dependency-path: installer/go.sum
- run: go test ./internal/media/... ./internal/host/... ./cmd/installer/...

# Die Medien-Vorbereitung auf macOS mit dem echten Imager. Der Imager
# schreibt nur auf eine RAM-Disk, das Schreibrecht dafuer gilt nur auf dem
# Wegwerf-Runner. Der Passwortdialog selbst bleibt ungeprueft.
installer-macos:
name: Installer media end to end (macOS)
needs: changes
if: needs.changes.outputs.installer_macos == 'true' || github.event_name == 'push'
runs-on: macos-latest
timeout-minutes: 30
permissions:
contents: read
defaults:
run:
shell: bash
working-directory: installer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: installer/go.mod
cache-dependency-path: installer/go.sum
- name: Install the Raspberry Pi Imager
run: brew install --cask raspberry-pi-imager
- name: Unit tests of the media mode
run: go test ./internal/media/... ./internal/host/... ./cmd/installer/...
- name: Create the RAM disk
run: |
dev=$(hdiutil attach -nomount ram://2500000 | awk '{print $1}')
if ! [[ "$dev" =~ ^/dev/disk[0-9]+$ ]]; then
echo "::error::keine RAM-Disk: '$dev'"
exit 1
fi
echo "EN_MAC_RAMDISK=$dev" >> "$GITHUB_ENV"
- name: Give the RAM disk the node layout of a stick
run: |
dev="$EN_MAC_RAMDISK"
if ! [[ "$dev" =~ ^/dev/disk[0-9]+$ ]]; then
echo "::error::ungueltiges Geraet: '$dev'"
exit 1
fi
sudo chown root:operator "$dev" "/dev/r${dev#/dev/}"
sudo chmod 640 "$dev" "/dev/r${dev#/dev/}"
- name: Allow the imager to open the RAM disk
run: |
dev="$EN_MAC_RAMDISK"
if ! [[ "$dev" =~ ^/dev/disk[0-9]+$ ]]; then
echo "::error::ungueltiges Geraet: '$dev'"
exit 1
fi
sudo security authorizationdb write "sys.openfile.readwrite./dev/r${dev#/dev/}" allow
- name: End-to-end test on the RAM disk
run: go test -tags mediae2e ./internal/host -run TestMacMediaEndToEnd -v
- name: Remove the right
if: always()
run: |
dev="${EN_MAC_RAMDISK:-}"
if [[ "$dev" =~ ^/dev/disk[0-9]+$ ]]; then
sudo security authorizationdb remove "sys.openfile.readwrite./dev/r${dev#/dev/}" || true
fi
- name: Detach the RAM disk
if: always()
run: |
dev="${EN_MAC_RAMDISK:-}"
if [[ "$dev" =~ ^/dev/disk[0-9]+$ ]]; then
hdiutil detach "$dev" -force || true
fi

dashboard-js:
name: Dashboard (JS)
needs: changes
Expand All @@ -199,29 +270,60 @@ jobs:
- run: npm ci
- run: npm test

# Die Tests der Fakes, die der Smoke-Test benutzt. Eigener Job, damit sie
# neben den Laeufen statt davor laufen.
dashboard-fakes:
name: Demo fakes (tests)
needs: changes
if: needs.changes.outputs.dashboard_smoke == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: demo/fakes
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install pytest
- run: python -m pytest -q

# Ein Job je Zweig, jeder baut und startet sein eigenes Dashboard. Jeder Lauf
# von smoke.sh steht in genau einem Zweig (scripts/tests/test_smoke_runs.py).
dashboard-smoke:
name: Dashboard smoke test
name: Dashboard smoke test (${{ matrix.teil }})
needs: changes
if: needs.changes.outputs.dashboard_smoke == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- teil: kern
laeufe: --run kern
- teil: updates
laeufe: --run updates
- teil: zugang
laeufe: --run zugang
- teil: system
laeufe: --run system
- teil: varianten
laeufe: --run ohne-dienste --run bilanz --run seed --run falsches-passwort
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: dashboard/go.mod
cache-dependency-path: dashboard/go.sum
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install pytest
- name: Fake tests
working-directory: demo/fakes
run: python -m pytest -q
- name: Smoke test
run: dashboard/test/smoke/smoke.sh
run: dashboard/test/smoke/smoke.sh ${{ matrix.laeufe }}
- if: failure()
uses: actions/upload-artifact@v4
with:
name: dashboard-smoke-logs
name: dashboard-smoke-logs-${{ matrix.teil }}
path: dashboard/test/smoke/.run/
if-no-files-found: ignore

Expand All @@ -238,6 +340,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: installer/webui/go.mod
- run: test -z "$(gofmt -l .)"
- run: go vet ./...
- run: go test ./...
Expand Down Expand Up @@ -273,6 +376,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: installer/webui/go.mod
- uses: actions/setup-node@v4
with:
node-version: 22
Expand Down Expand Up @@ -312,6 +416,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: installer/go.mod
cache-dependency-path: installer/go.sum
- name: Build for ${{ matrix.target }}
env:
TARGET: ${{ matrix.target }}
Expand Down Expand Up @@ -532,7 +637,9 @@ jobs:
- dashboard-go
- installer-go
- installer-windows
- installer-macos
- dashboard-js
- dashboard-fakes
- dashboard-smoke
- installer-webui-go
- installer-webui-js
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/installer-macos-media.yml

This file was deleted.

7 changes: 6 additions & 1 deletion dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## v0.11.22-pre.38 (2026-11-06)
## v0.11.22-pre.39 (2026-11-06)

### Features

Expand Down Expand Up @@ -546,6 +546,7 @@

### Tests

- **smoke:** split the main run into four independent runs (fa7e3df)
- **demo:** expect a sure effect beside the estimates (aa987aa)
- **demo:** fake the system packages for the versions page (ca2dc1e)
- **autolearn:** keep the cycle test window open until today (ab438d5)
Expand Down Expand Up @@ -606,6 +607,10 @@
- **webui:** record the cache-bust history for the performance check assets (c01d9e9)
- **webui:** record the cache-bust marks of the performance page (5b896c1)

### CI

- parallelize the smoke test and run the macOS media check (#302)

## v0.11.20 (2026-11-16)

### Features
Expand Down
2 changes: 1 addition & 1 deletion dashboard/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.11.22-pre.38
v0.11.22-pre.39
31 changes: 21 additions & 10 deletions dashboard/test/smoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ demo, which keeps it running until Ctrl-C: see [demo/README.md](../../../demo/RE
The fakes and fixtures are described there too.

```bash
dashboard/test/smoke/smoke.sh # all five runs
dashboard/test/smoke/smoke.sh --run haupt # one run, the option can be repeated
dashboard/test/smoke/smoke.sh # all eight runs
dashboard/test/smoke/smoke.sh --run kern # one run, the option can be repeated
dashboard/test/smoke/smoke.sh --run haupt # short for kern, updates, zugang, system
dashboard/test/smoke/smoke.sh --list # the runs and their check groups
```

The runs always execute in the same order (`haupt`, `ohne-dienste`, `bilanz`, `seed`,
`falsches-passwort`),
The runs always execute in the same order (`kern`, `updates`, `zugang`, `system`,
`ohne-dienste`, `bilanz`, `seed`, `falsches-passwort`),
whatever order `--run` names them in. Each run starts a fresh dashboard in its
own directory `.run/<name>-XXXXXX` below this folder. A passed run deletes that
directory, a failed run keeps it for analysis. The script exits with 0 only when
Expand All @@ -26,20 +28,25 @@ all selected runs pass.
Before a run starts, all five ports below are checked. A port that is already in
use makes the run fail, and the script leaves the process that holds it alone.

## The five runs
## The eight runs

| Run | Configuration | Check groups |
|---|---|---|
| `haupt` | Sources, fixture and seed data of the demo (`demo/demo.sh`), HTTPS, simulated power values, service logs, installed state, package and update fake | `topics`, `battery_config`, `shelly`, `seed`, `dataflow`, `live_push`, `update_offer`, `package`, `installed`, `journal`, `users`, `onboarding`, `update_install`, `companion`, `history_exchange`, `backup`, `storage`, `network`, `settings_subpages`, `performance` |
| `kern` | Sources, fixture and seed data of the demo (`demo/demo.sh`), HTTPS, simulated power values, service logs, installed state, package and update fake | `topics`, `battery_config`, `shelly`, `seed`, `dataflow`, `live_push` |
| `updates` | The same as `kern` | `update_offer`, `package`, `installed`, `update_install` |
| `zugang` | The same as `kern` | `journal`, `users`, `onboarding`, `companion`, `history_exchange` |
| `system` | The same as `kern` | `backup`, `storage`, `network`, `settings_subpages`, `performance`, `monitoring` |
| `ohne-dienste` | The demo sources, but all seven services switched off | `services_off` |
| `bilanz` | `energie-ueberschuss.json` with the seed set `energie-alle-karten`, only the battery service, no simulation | `seed`, `energy_balance`, `companion` |
| `seed` | The demo sources, plus an installer `onboarding-seed.json` next to `auth.pw` before the start | `onboarding_seed` |
| `falsches-passwort` | The demo sources, but the MQTT password of the dashboard is wrong. The fake broker accepts only the right one (`--login`) and rejects the connection | `mqtt_falsch` |

Why each run exists:

- **`haupt`** checks the demo itself. The demo shows the same fixture, the same
seed data and the same services.
- **`kern`, `updates`, `zugang` and `system`** check the demo itself. The demo
shows the same fixture, the same seed data and the same services. They are four
runs so that CI can execute them side by side. Each one has to pass on its own,
so a check group must not depend on a group of another run.
- **`ohne-dienste`** contradicts the demo on purpose. With all seven services
off, only the `services_off` group applies.
- **`bilanz`** needs exact energy values, which the simulation in the demo
Expand Down Expand Up @@ -67,7 +74,11 @@ other ports, set the variables above before the call.

## CI

The CI job `dashboard-smoke` runs the same script (see `.github/workflows/ci.yml`).
The CI job `dashboard-smoke` runs the same script as a matrix: `kern`, `updates`,
`zugang` and `system` as one job each, the other four runs together as
`varianten` (see `.github/workflows/ci.yml`). The tests of the fakes run in the
job `dashboard-fakes`. A new check group goes into `gruppe()` and into one run
in `gruppen_fuer()`, which `scripts/tests/test_smoke_runs.py` checks.

## What is checked

Expand Down Expand Up @@ -98,7 +109,7 @@ truth for the details.
rights gets 403, no session 401, and deleted archives leave the status
- the performance API under `/api/v1/performance` answers 200 with rows, units,
target and measured time, and the settings page Leistung carries both tour
targets (`performance-budget`, `performance-measure`); the run `haupt` sets
targets (`performance-budget`, `performance-measure`); the run `system` sets
`ENERGY_NODE_PERFORMANCE_FAKE=1` so the values are the invented ones
- with the simulation on, the PV power under `/api/v1/topics/samples` changes
within ten seconds, proof that the simulated values arrive as MQTT `PUBLISH`
Expand Down
Loading
Loading