Skip to content

ci: reusable e2e workflow and image variables in compose - #75

Draft
Acruve15 wants to merge 8 commits into
pyronear:feat/fake-reolink-camerafrom
Acruve15:alexis/e2e-workflow
Draft

Acruve15 wants to merge 8 commits into
pyronear:feat/fake-reolink-camerafrom
Acruve15:alexis/e2e-workflow

Conversation

@Acruve15

@Acruve15 Acruve15 commented Nov 12, 2026 •

Copy link
Copy Markdown

Problem

make e2e only runs on a laptop. Nothing runs it when pyro-api, the platform or the engine merge, and the old compose workflow is disabled. #55 asks for one reusable workflow here that the three app repos call with their new image.

What this adds

  • docker-compose.yml: the 4 app images become variables (API_IMAGE, PLATFORM_IMAGE, ENGINE_IMAGE, CAMERA_API_IMAGE), full reference so a digest works. Empty -> latest.
  • .github/workflows/e2e.yml, one job: pull the images, write versions.json, make e2e, upload e2e-artifacts/ and versions.json.
  • Triggers: workflow_call, workflow_dispatch, PRs here, nightly at 03:17 UTC (upstream only).
  • A PR here tests its own code. An app repo gets pyro-envdev at envdev_ref (default main).

Flow

Example

What an app repo adds after its image push:

jobs:
  e2e:
    uses: pyronear/pyro-envdev/.github/workflows/e2e.yml@main
    with:
      api_image: pyronear/alert-api@sha256:<digest>

versions.json, local dry run (shortened, on never-smoke):

{
  "images": {
    "pyro_api": {
      "reference": "pyronear/alert-api@sha256:0467...0e92",
      "digest": "pyronear/alert-api@sha256:0467...0e92"
    },
    "frontend": {
      "reference": "pyronear/pyro-platform-react:latest",
      "digest": "pyronear/pyro-platform-react@sha256:b5b8...6f34"
    }
  },
  "envdev_commit": "03f21a7e1e1d922e36bd485ed768770c8ef90a05",
  "scenario": "never-smoke",
  "scenario_zip_sha256": "2092...7c2b"
}

Checks

Check Result
The workflow on GitHub, first run on this PR (43235781421) red, as expected: checkout, setup-uv, make init and the image pull pass, then "Record versions.json" stops on the 404 below
actionlint (with shellcheck) on e2e.yml clean
Resolve step and versions.json step, run locally under bash -eo pipefail valid JSON, defaults applied when an input is empty
docker compose config: no variable, 4 overrides, empty variable defaults, overrides, default
make e2e SCENARIO=smoke-one-camera with API_IMAGE set to a digest, fresh stack exit 0, 5 API tests and 3 browser tests passed, the api container runs the @sha256 reference
Offline suite 35 passed, 6 deselected
The pre-commit hooks by hand on the 27 files of the stack (YAML, JSON and Python parse, whitespace, end of file, black 23.3.0, ruff 0.0.290) clean. The safety and hadolint hooks were not run

Local runs on an arm64 Mac, amd64 emulation.

Before the first green run

Open points

Part of #55.

A test can now prove which scenario a fake camera is playing before it asserts on it. The four tests that need a live camera on 127.0.0.1:8443 get the integration marker.
…o.json

scenario.json gains an expected block (alerts, sequences, location, timeout_s), validated offline by tests/test_scenarios.py. tests/e2e waits for the first alert, then for every fake camera to finish, and compares what the API returns with that block. Tests that need Postgres or S3 get the integration marker so the offline suite passes with no stack.
Fresh stack, in-repo images built, engine and front profiles up, then the e2e tests. The exit code is kept and the compose logs, ps and junit go to e2e-artifacts/. The three images with no arm64 manifest are pinned to linux/amd64 so the stack starts on Apple Silicon.
Writes the frames into <camera>/<preset>/ and takes the sequence seen on the pose whose patrol_id is that preset. Without --preset nothing changes.
A preset plays <scenario>/<camera>/<preset>/*.jpg when the folder exists and falls back to the camera-level frames, so the existing scenarios are unchanged. finished now waits for every preset declared in poses, and GET /scenario reports visits, frame and frames per preset. The e2e never-polled abort keys on those visits.
Preset 3 of croix-augas-01 plays 18 frames of prod alert 49767 then a clear frame, the six other poses hold one clear frame. Expected: one alert, one sequence on that pose. SCENARIOS_URL can now be overridden, so the images can be fetched from another release.
Three read-only tests in tests/e2e/ui on the smoke-one-camera alert: the alert
card names the camera, the player image is loaded and is one the API serves for
the sequence, the close-up is one of its crops and can be hidden and shown.

One login for the session through the real login page, reused through the
storage state. make e2e runs the API tests then the browser tests, and
make e2e-install installs Chromium.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant